Skip to content

Commit

Permalink
export bones by default
Browse files Browse the repository at this point in the history
  • Loading branch information
xypwn committed Jun 3, 2024
1 parent 7f1a03c commit a62d0e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ var ConfigFormat = ConfigTemplate{
Type: ConfigValueEnum,
Enum: []string{"false", "true"},
},
"bones": {
"no_bones": {
Type: ConfigValueEnum,
Enum: []string{"disabled", "enabled"},
Enum: []string{"false", "true"},
},
"image_jpeg": {
Type: ConfigValueEnum,
Expand Down
6 changes: 3 additions & 3 deletions extractor/unit/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,13 @@ func ConvertOpts(ctx extractor.Context, imgOpts *ImageOptions) error {
}
}

boneCfg := ctx.Config()["bones"]
bonesEnabled := ctx.Config()["no_bones"] != "true"

var skin *uint32 = nil
var weights uint32 = 0
var joints uint32 = 0

if boneCfg == "enabled" {
if bonesEnabled {
if len(unitInfo.SkeletonMaps) > 0 {
remapMeshBones(&mesh, unitInfo.SkeletonMaps[0])
}
Expand Down Expand Up @@ -494,7 +494,7 @@ func ConvertOpts(ctx extractor.Context, imgOpts *ImageOptions) error {
Material: material,
}

if boneCfg == "enabled" {
if bonesEnabled {
primitive.Attributes[gltf.JOINTS_0] = joints
primitive.Attributes[gltf.WEIGHTS_0] = weights
}
Expand Down

0 comments on commit a62d0e0

Please sign in to comment.