Skip to content

Commit 7f86ca0

Browse files
committed
Merge pull request #96308 from SaracenOne/attempt_to_reset_imported_scene
Attempt applying RESET pose during import.
2 parents acc4879 + 3125325 commit 7f86ca0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

editor/import/3d/resource_importer_scene.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -3104,6 +3104,19 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
31043104
}
31053105
}
31063106

3107+
// Apply RESET animation before serializing.
3108+
if (_scene_import_type == "PackedScene") {
3109+
int scene_child_count = scene->get_child_count();
3110+
for (int i = 0; i < scene_child_count; i++) {
3111+
AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(scene->get_child(i));
3112+
if (ap) {
3113+
if (ap->can_apply_reset()) {
3114+
ap->apply_reset();
3115+
}
3116+
}
3117+
}
3118+
}
3119+
31073120
if (post_import_script.is_valid()) {
31083121
post_import_script->init(p_source_file);
31093122
scene = post_import_script->post_import(scene);

0 commit comments

Comments
 (0)