Beispiel #1
0
    public IAnimationChannel GetAnimationChannel(string channelName)
    {
        for (int i = 0; i < this.animationChannels.Count; i++)
        {
            IAnimationChannel channel = this.animationChannels[i];

            if (string.CompareOrdinal(channel.GetChannelName(), channelName) == 0)
            {
                return(channel);
            }
        }

        return(null);
    }
Beispiel #2
0
    public void BindAllChannels(Dictionary <string, TransformBase> animationTransforms)
    {
        for (int i = 0; i < this.animationChannels.Count; i++)
        {
            IAnimationChannel channel     = this.animationChannels[i];
            string            channelName = channel.GetChannelName();

            //Bind channel to a transform.
            if (animationTransforms.ContainsKey(channelName))
            {
                TransformBase animationTransform = animationTransforms[channelName];

                //Bind channel to animatable transform.
                channel.Bind(animationTransform);
            }
        }
    }
Beispiel #3
0
    public void AddAnimationChannel(IAnimationChannel channel)
    {
        if (this.animationChannels != null)
        {
            //Remove previous entry if there is one.
            RemoveAnimationChannel(channel.GetChannelName());

            //Add channel to our iterator list.
            this.animationChannels.Add(channel);

            //Find the channel that is the longest within this animation clip, that channel determines the clips total length.
            float channelLength = (float)((float)channel.GetLength() / this.framerate);
            if (channelLength > this.maxChannelLength)
            {
                this.maxChannelLength = channelLength;
            }
        }
    }
    public void SetLipSyncChannels(List <IAnimationChannel> animationChannels)
    {
        for (int i = 0; i < animationChannels.Count; i++)
        {
            IAnimationChannel channel     = animationChannels[i];
            string            channelName = channel.GetChannelName();

            switch (channelName)
            {
            case "Mid_Head_Jnt_03":
                jawChannel = channel as RotationChannel;
                break;

            case "Corner_In":
                cornerinChannel = channel as MorphChannel;
                break;

            case "I":
                iChannel = channel as MorphChannel;
                break;

            case "Lip_LowerUp":
                lowerUpChannel = channel as MorphChannel;
                break;

            case "Lip_LowerDown":
                lowerDownChannel = channel as MorphChannel;
                break;

            case "Lip_UpperUp":
                upperUpChannel = channel as MorphChannel;
                break;

            case "Lip_UpperDown":
                upperDownChannel = channel as MorphChannel;
                break;
            }
        }
    }