Пример #1
0
        public void Setup()
        {
#if UNITY_EDITOR
            PlaymodeTestsEditorSetup.CreateStreamingAssetsDirectory();

            {
                var motionClip = CreateLinearDenseClip
                                 (
                    new[]
                {
                    new LinearBinding <float3> {
                        Path = "Motion", ValueStart = m_StartTranslation, ValueEnd = m_StopTranslation
                    },
                },
                    new[]
                {
                    new LinearBinding <quaternion> {
                        Path = "Motion", ValueStart = math.normalize(m_StartRotation), ValueEnd = math.normalize(m_StopRotation)
                    },
                },
                    new[]
                {
                    new LinearBinding <float3> {
                        Path = "Motion", ValueStart = new float3(1, 1, 1), ValueEnd = new float3(1, 1, 1)
                    }
                }
                                 );

                var blobPath = "MotionClip.blob";
                BlobFile.WriteBlobAsset(ref motionClip, blobPath);
            }
#endif
        }
Пример #2
0
        public static void BuildClipBlobAsset(string path)
        {
            var animationClip = AssetDatabase.LoadMainAssetAtPath(path) as AnimationClip;

            if (animationClip == null)
            {
                throw new NullReferenceException($"Asset '{path}' not found");
            }

            var blobPath = GetBlobAssetPath(path);

            var clip = ClipBuilder.AnimationClipToDenseClip(animationClip);

            BlobFile.WriteBlobAsset(ref clip, blobPath);
        }
Пример #3
0
        public static void BuildRigDefinitionBlobAsset(string path)
        {
            var gameObject = AssetDatabase.LoadMainAssetAtPath(path) as GameObject;

            if (gameObject == null)
            {
                throw new NullReferenceException($"Asset '{path}' not found");
            }

            var blobPath = GetBlobAssetPath(path);

            var skeletonNode = RigGenerator.ExtractSkeletonNodesFromGameObject(gameObject);

            var rigDefinition = RigBuilder.CreateRigDefinition(skeletonNode);

            BlobFile.WriteBlobAsset(ref rigDefinition, blobPath);
        }