Exemple #1
0
        public bool TryGetPathWithPropertyFromChannel(ChannelCurve channel, out PathWithProperty pathWithProp)
        {
            var index = Channels.ToList().IndexOf(channel);

            if (index == -1)
            {
                pathWithProp = default(PathWithProperty);
                return(false);
            }

            foreach (var node in Root.Traverse())
            {
                for (int i = 0; i < node.Channels.Length; ++i, --index)
                {
                    if (index == 0)
                    {
                        pathWithProp = new PathWithProperty
                        {
                            Path       = GetPath(node),
                            Property   = node.Channels[i].ToProperty(),
                            IsLocation = node.Channels[i].IsLocation(),
                        };
                        return(true);
                    }
                }
            }

            throw new BvhException("channel is not found");
        }
Exemple #2
0
            public void Set(string prop, Bvh.ChannelCurve curve)
            {
                switch (prop)
                {
                case "localPosition.x":
                    LocalPositionX = curve;
                    break;

                case "localPosition.y":
                    LocalPositionY = curve;
                    break;

                case "localPosition.z":
                    LocalPositionZ = curve;
                    break;

                case "localEulerAnglesBaked.x":
                    EulerX = curve;
                    break;

                case "localEulerAnglesBaked.y":
                    EulerY = curve;
                    break;

                case "localEulerAnglesBaked.z":
                    EulerZ = curve;
                    break;

                default:
                    break;
                }
            }