Beispiel #1
0
 protected override void Clear()
 {
     // m_settingsInspector
     UnityEditor.Editor.DestroyImmediate(m_settingsInspector);
     m_settingsInspector = null;
     // m_meshesInspector
     UnityEditor.Editor.DestroyImmediate(m_meshesInspector);
     m_meshesInspector = null;
     // Meta
     Vrm = null;
     ScriptableObject.DestroyImmediate(m_tmpObject);
     m_tmpObject = null;
     // m_settings
     ScriptableObject.DestroyImmediate(m_settings);
     m_settings = null;
     // m_meshes
     ScriptableObject.DestroyImmediate(m_meshes);
     m_meshes = null;
 }
Beispiel #2
0
        protected override void Initialize()
        {
            m_tmpObject              = ScriptableObject.CreateInstance <VRM10Object>();
            m_tmpObject.name         = "_vrm1_";
            m_tmpObject.Meta.Authors = new List <string> {
                ""
            };

            m_settings          = ScriptableObject.CreateInstance <VRM10ExportSettings>();
            m_settingsInspector = Editor.CreateEditor(m_settings);

            m_meshes          = ScriptableObject.CreateInstance <MeshExportValidator>();
            m_meshesInspector = Editor.CreateEditor(m_meshes);

            State.ExportRootChanged += (root) =>
            {
                // update meta
                if (root == null)
                {
                    Vrm = null;
                }
                else
                {
                    var controller = root.GetComponent <Vrm10Instance>();
                    if (controller != null)
                    {
                        Vrm = controller.Vrm;
                    }
                    else
                    {
                        Vrm = null;
                    }

                    // default setting
                    // m_settings.PoseFreeze =
                    // MeshUtility.Validators.HumanoidValidator.HasRotationOrScale(root)
                    // || m_meshes.Meshes.Any(x => x.ExportBlendShapeCount > 0 && !x.HasSkinning)
                    // ;
                }
            };
        }