Skip to content

Commit

Permalink
Support Import As Skeleton Bones on glTF and AnimationLibrary import
Browse files Browse the repository at this point in the history
  • Loading branch information
lyuma committed May 21, 2024
1 parent bd2300d commit ef486db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion editor/import/3d/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ bool ResourceImporterScene::get_option_visibility(const String &p_path, const St
}
}

if (animation_importer && (p_option.begins_with("nodes/") || p_option.begins_with("meshes/") || p_option.begins_with("skins/"))) {
if (animation_importer && (p_option == "nodes/root_type" || p_option == "nodes/root_name" || p_option.begins_with("meshes/") || p_option.begins_with("skins/"))) {
return false; // Nothing to do here for animations.
}

Expand Down
3 changes: 3 additions & 0 deletions modules/gltf/editor/editor_scene_importer_gltf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Node *EditorSceneFormatImporterGLTF::import_scene(const String &p_path, uint32_t
int32_t enum_option = p_options["gltf/embedded_image_handling"];
state->set_handle_binary_image(enum_option);
}
if (p_options.has(SNAME("nodes/import_as_skeleton_bones")) ? (bool)p_options[SNAME("nodes/import_as_skeleton_bones")] : false) {
state->set_import_as_skeleton_bones(true);
}
Error err = gltf->append_from_file(p_path, state, p_flags);
if (err != OK) {
if (r_err) {
Expand Down

0 comments on commit ef486db

Please sign in to comment.