浏览代码

Merge pull request #34997 from fire/loop-fbx-32678

Use cycle and loop hint flags in FBX.
Rémi Verschelde 5 年之前
父节点
当前提交
14c9316f45
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      modules/assimp/editor_scene_importer_assimp.cpp

+ 4 - 0
modules/assimp/editor_scene_importer_assimp.cpp

@@ -732,6 +732,10 @@ void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_anim
 	animation->set_name(name);
 	animation->set_length(anim->mDuration / ticks_per_second);
 
+	if (name.begins_with("loop") || name.ends_with("loop") || name.begins_with("cycle") || name.ends_with("cycle")) {
+		animation->set_loop(true);
+	}
+
 	// generate bone stack for animation import
 	RegenerateBoneStack(state);