Prechádzať zdrojové kódy

Attempt applying RESET pose during import.

Saracen 1 rok pred
rodič
commit
31253257b3
1 zmenil súbory, kde vykonal 13 pridanie a 0 odobranie
  1. 13 0
      editor/import/3d/resource_importer_scene.cpp

+ 13 - 0
editor/import/3d/resource_importer_scene.cpp

@@ -3096,6 +3096,19 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
 		}
 	}
 
+	// Apply RESET animation before serializing.
+	if (_scene_import_type == "PackedScene") {
+		int scene_child_count = scene->get_child_count();
+		for (int i = 0; i < scene_child_count; i++) {
+			AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(scene->get_child(i));
+			if (ap) {
+				if (ap->can_apply_reset()) {
+					ap->apply_reset();
+				}
+			}
+		}
+	}
+
 	if (post_import_script.is_valid()) {
 		post_import_script->init(p_source_file);
 		scene = post_import_script->post_import(scene);