public GenericBinding FindBinding(int index)
        {
            int curves = 0;

            for (int i = 0; i < GenericBindings.Count; i++)
            {
                GenericBinding gb = GenericBindings[i];
                if (gb.Attribute == 2)                // Quaternion
                {
                    curves += 4;
                }
                else if (gb.Attribute <= 4)                // Vector3
                {
                    curves += 3;
                }
                else                 // float
                {
                    curves++;
                }
                if (curves > index)
                {
                    return(gb);
                }
            }

            return(default);
Example #2
0
        public GenericBinding FindBinding(int index)
        {
            int curves = 0;

            for (int i = 0; i < GenericBindings.Count; i++)
            {
                GenericBinding gb = GenericBindings[i];
                if (gb.ClassID == ClassIDType.Transform)
                {
                    curves += gb.BindingType.GetDimension();
                }
                else
                {
                    curves += 1;
                }

                if (curves > index)
                {
                    return(gb);
                }
            }
            throw new ArgumentException($"Binding with index {index} wasn't found", nameof(index));
        }
Example #3
0
        private static bool GetGenericBinding(AnimationClipBindingConstant bindings, int index, out GenericBinding binding)
        {
            binding = bindings.FindBinding(index);
            if (binding.ClassID == ClassIDType.Transform)
            {
                return(true);
            }
#warning TODO: humanoid
            return(false);
        }