Пример #1
0
        void UpdateRoot(GameObject root)
        {
            if (root == ExportRoot)
            {
                return;
            }
            m_requireValidation = true;
            ExportRoot          = root;
            UnityEditor.Editor.DestroyImmediate(m_metaEditor);
            m_metaEditor = null;

            if (ExportRoot == null)
            {
                Meta = null;
            }
            else
            {
                // default setting
                m_settings.PoseFreeze = VRMExporterValidator.HasRotationOrScale(ExportRoot);

                var meta = ExportRoot.GetComponent <VRMMeta>();
                if (meta != null)
                {
                    Meta = meta.Meta;
                }
                else
                {
                    Meta = null;
                }
            }
        }
Пример #2
0
        public static void CreateWizard()
        {
            var wiz = VRMExporterWizard.DisplayWizard();
            var go  = Selection.activeObject as GameObject;

            // update checkbox
            wiz.UpdateRoot(go);

            if (go != null)
            {
                wiz.m_settings.PoseFreeze = VRMExporterValidator.HasRotationOrScale(go);
            }

            wiz.OnWizardUpdate();
        }
Пример #3
0
        void UpdateRoot(GameObject root)
        {
            if (root == ExportRoot)
            {
                return;
            }
            m_requireValidation = true;
            ExportRoot          = root;
            UnityEditor.Editor.DestroyImmediate(m_metaEditor);
            m_metaEditor = null;

            if (ExportRoot == null)
            {
                Meta = null;
            }
            else
            {
                // do validation
                Validate();

                // default setting
                m_settings.PoseFreeze =
                    VRMExporterValidator.HasRotationOrScale(ExportRoot) ||
                    m_meshes.Meshes.Any(x => x.ExportBlendShapeCount > 0 && !x.HasSkinning)
                ;

                var meta = ExportRoot.GetComponent <VRMMeta>();
                if (meta != null)
                {
                    Meta = meta.Meta;
                }
                else
                {
                    Meta = null;
                }
            }
        }
        public void DetectFileNameLength(string fileName, bool isIllegal)
        {
            var result = VRMExporterValidator.IsFileNameLengthTooLong(fileName);

            Assert.AreEqual(result, isIllegal);
        }