Example #1
0
 private void AddMixingTransform(MixingTransformData ms)
 {
     if (!_MixingTransforms.ContainsKey(ms.TransformPath))
     {
         _MixingTransforms.Add(ms.TransformPath, ms);
     }
 }
Example #2
0
        private void CheckForRecursive(BoneData bone)
        {
            if (_MixingTransforms.ContainsKey(bone.RootPath))
            {
                MixingTransformData ms = _MixingTransforms[bone.RootPath];
                _MixList.Add(ms);
                if (!ms.Recursive)
                {
                    if (IsAllChildMixed(bone))
                    {
                        ms.Recursive = true;
                    }
                }
                if (ms.Recursive)
                {
                    foreach (var b in bone)
                    {
                        RemoveRecursive(b);
                    }
                    return;
                }
            }

            foreach (var b in bone)
            {
                CheckForRecursive(b);
            }
        }
Example #3
0
 private void AddMixingTransform(BaseControl control)
 {
     if (!_MixingTransforms.ContainsKey(((BoneData)control.UserData).RootPath))
     {
         MixingTransformData ms = new MixingTransformData();
         ms.Recursive     = false;
         ms.TransformPath = ((BoneData)control.UserData).RootPath;
         _MixingTransforms.Add(ms.TransformPath, ms);
     }
 }
Example #4
0
        /// <summary>
        /// Load AnimationClip data from XmlElement
        /// </summary>
        /// <param name="e">XmlElement to load</param>
        public void Load(XmlElement e)
        {
            this.Name     = e.GetAttributeValueAsString("Name", Name);
            this.WrapMode = (WrapMode)e.GetAttributeValueAsInt("WrapMode", 0);
            this.Length   = e.GetAttributeValueAsFloat("Length", 0);

            XmlElement mixingTransforms = e["MixingTransforms"];

            if (mixingTransforms != null)
            {
                int count = mixingTransforms.GetAttributeValueAsInt("Count", 0);
                int i     = 0;
                MixingTransforms = new MixingTransformData[count];
                foreach (var transform in mixingTransforms)
                {
                    MixingTransformData mt = new MixingTransformData();
                    mt.Load(transform);
                    this.MixingTransforms[i++] = mt;
                }
            }
            else
            {
                this.MixingTransforms = null;
            }

            XmlElement rootMotion = e[RootMotionData.ElementName];

            if (rootMotion != null)
            {
                this.RootMotion.Load(rootMotion);
            }

            XmlElement rootmotionState = e[RootMotionStateData.ElementName];

            if (rootmotionState != null)
            {
                this.RootMotionState.Load(rootmotionState);
            }
        }