I want to generate dataset of human faces to train Netural Networks. So I wrote scripts to capture snapshot of camera while enter play mode by using "EditorApplication.isPlaying = true;", now the DynamicCharacterAvatar doesn't render the character so I capture nothing... How should I dynamically create and modify Avatar of UMA in play mode of Unity Editor?
Now I use following codes to create GameObject and DynamicCharacterAvatar:
// callback from EditorApplication.playModeStateChanged when enter play mode
GameObject avatarObject = GameObject.Find("tmp_avatar");
if (avatarObject == null)
avatarObject = new GameObject("tmp_avatar");
DynamicCharacterAvatar avatar = avatarObject.GetComponent<DynamicCharacterAvatar>();
if (avatar == null)
avatar = avatarObject.AddComponent<DynamicCharacterAvatar>();
avatar.CreateEditorContext();
avatar.ChangeRace("HumanMaleDCS");
RuntimeAnimatorController controller = (RuntimeAnimatorController)UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath("Assets/UMA/Examples/DynamicCharacterSystem Examples/Assets/DynamicDNA/Animation/UMA_TPose_Controller.controller");
avatar.KeepAnimatorController = true;
avatar.animationController = controller ;
avatar.BuildCharacter();
But the character doesn't show in play mode of Unity Editor.
I want to generate dataset of human faces to train Netural Networks. So I wrote scripts to capture snapshot of camera while enter play mode by using "EditorApplication.isPlaying = true;", now the DynamicCharacterAvatar doesn't render the character so I capture nothing... How should I dynamically create and modify Avatar of UMA in play mode of Unity Editor?
Now I use following codes to create GameObject and DynamicCharacterAvatar:
But the character doesn't show in play mode of Unity Editor.