Esempio n. 1
0
 public FbxColor(FbxDouble3 pRGB) : this(FbxWrapperNativePINVOKE.new_FbxColor__SWIG_4(FbxDouble3.getCPtr(pRGB)), true)
 {
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 2
0
 public FbxColor(FbxDouble3 pRGB, double pAlpha) : this(fbx_wrapperPINVOKE.new_FbxColor__SWIG_3(FbxDouble3.getCPtr(pRGB), pAlpha), true)
 {
     if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
     {
         throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 3
0
 public FbxVector4(FbxDouble3 pValue) : this(fbx_wrapperPINVOKE.new_FbxVector4__SWIG_5(FbxDouble3.getCPtr(pValue)), true)
 {
     if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
     {
         throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 4
0
        //public static double[] ToDouble3Array( FbxVector4 value )
        //{
        //	SWIGTYPE_p_double data = value.mData;
        //	DoubleArray d = DoubleArray.frompointer( data );
        //	return new double[]{ d.getitem( 0 ), d.getitem( 1 ), d.getitem( 2 ) };
        //}

        public static Vector3 ToVector3(this FbxDouble3 value)
        {
            SWIGTYPE_p_double data = value.mData;
            DoubleArray       d    = DoubleArray.frompointer(data);

            return(new Vector3(d.getitem(0), d.getitem(1), d.getitem(2)));
        }
Esempio n. 5
0
 public void SetMax(FbxDouble3 pMax)
 {
     fbx_wrapperPINVOKE.FbxLimits_SetMax(swigCPtr, FbxDouble3.getCPtr(pMax));
     if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
     {
         throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 6
0
 public void SetMax(FbxDouble3 pMax)
 {
     NativeMethods.FbxLimits_SetMax(swigCPtr, pMax);
     if (NativeMethods.SWIGPendingException.Pending)
     {
         throw NativeMethods.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 7
0
 public void SetMin(FbxDouble3 pMin)
 {
     FbxWrapperNativePINVOKE.FbxLimits_SetMin(swigCPtr, FbxDouble3.getCPtr(pMin));
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 8
0
    public static FbxDouble3 ConvertToFbxScale(Vector3 Vector)
    {
        FbxDouble3 Out = new FbxDouble3();

        Out.setDataValue(0, Vector[2]);
        Out.setDataValue(1, Vector[0]);
        Out.setDataValue(2, Vector[1]);
        return(Out);
    }
Esempio n. 9
0
        public FbxDouble3 EvaluateValue(FbxTime pTime, bool pForceEval)
        {
            FbxDouble3 ret = new FbxDouble3(fbx_wrapperPINVOKE.FbxPropertyTDouble3_EvaluateValue__SWIG_0(swigCPtr, FbxTime.getCPtr(pTime), pForceEval), true);

            if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
            {
                throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public FbxPropertyTFbxDouble3 Set(FbxDouble3 pValue)
        {
            FbxPropertyTFbxDouble3 ret = new FbxPropertyTFbxDouble3(FbxWrapperNativePINVOKE.FbxPropertyTFbxDouble3_Set(swigCPtr, FbxDouble3.getCPtr(pValue)), false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 11
0
        public FbxDouble3 Apply(FbxDouble3 pVector)
        {
            FbxDouble3 ret = new FbxDouble3(fbx_wrapperPINVOKE.FbxLimits_Apply(swigCPtr, FbxDouble3.getCPtr(pVector)), true);

            if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
            {
                throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 12
0
        public FbxColor assign(FbxDouble3 pColor)
        {
            FbxColor ret = new FbxColor(FbxWrapperNativePINVOKE.FbxColor_assign__SWIG_1(swigCPtr, FbxDouble3.getCPtr(pColor)), false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 13
0
        public bool eq(FbxDouble3 pVector)
        {
            bool ret = fbx_wrapperPINVOKE.FbxDouble3_eq(swigCPtr, FbxDouble3.getCPtr(pVector));

            if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
            {
                throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 14
0
        public FbxDouble3 assign(FbxDouble2 pVector)
        {
            FbxDouble3 ret = new FbxDouble3(fbx_wrapperPINVOKE.FbxDouble3_assign__SWIG_1(swigCPtr, FbxDouble2.getCPtr(pVector)), false);

            if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
            {
                throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 15
0
        public FbxProperty StaticInit(FbxObject pObject, string pName, FbxDouble3 pValue, bool pForceSet, FbxPropertyFlags.EFlags pFlags)
        {
            FbxProperty ret = new FbxProperty(fbx_wrapperPINVOKE.FbxPropertyTDouble3_StaticInit__SWIG_0(swigCPtr, FbxObject.getCPtr(pObject), pName, FbxDouble3.getCPtr(pValue), pForceSet, (int)pFlags), false);

            if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
            {
                throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public FbxProperty StaticInit(FbxObject pObject, string pName, FbxDouble3 pValue, bool pForceSet)
        {
            FbxProperty ret = new FbxProperty(FbxWrapperNativePINVOKE.FbxPropertyTFbxDouble3_StaticInit__SWIG_1(swigCPtr, FbxObject.getCPtr(pObject), pName, FbxDouble3.getCPtr(pValue), pForceSet), false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 17
0
        public FbxPropertyDouble3 Set(FbxDouble3 pValue)
        {
            FbxPropertyDouble3 ret = new FbxPropertyDouble3(NativeMethods.FbxPropertyDouble3_Set(swigCPtr, pValue), false);

            if (NativeMethods.SWIGPendingException.Pending)
            {
                throw NativeMethods.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 18
0
        public FbxDouble3 assign(FbxDouble3 pVector)
        {
            FbxDouble3 ret = new FbxDouble3(FbxWrapperNativePINVOKE.FbxDouble3_assign__SWIG_2(swigCPtr, FbxDouble3.getCPtr(pVector)), false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public FbxDouble3 EvaluateValue(FbxTime pTime)
        {
            FbxDouble3 ret = new FbxDouble3(FbxWrapperNativePINVOKE.FbxPropertyTFbxDouble3_EvaluateValue__SWIG_1(swigCPtr, FbxTime.getCPtr(pTime)), true);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 20
0
        public FbxDouble4 assign(FbxDouble3 pValue)
        {
            FbxDouble4 ret = new FbxDouble4(fbx_wrapperPINVOKE.FbxDouble4_assign__SWIG_1(swigCPtr, FbxDouble3.getCPtr(pValue)), false);

            if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
            {
                throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 21
0
        public FbxDouble3 Apply(FbxDouble3 pVector)
        {
            var ret = NativeMethods.FbxLimits_Apply(swigCPtr, pVector);

            if (NativeMethods.SWIGPendingException.Pending)
            {
                throw NativeMethods.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 22
0
        public bool ne(FbxDouble3 pVector)
        {
            bool ret = FbxWrapperNativePINVOKE.FbxDouble3_ne(swigCPtr, FbxDouble3.getCPtr(pVector));

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 23
0
            /// <summary>
            /// Convert scene's system units but leave scaling unchanged
            /// </summary>
            public void ConvertScene(FbxScene fbxScene, FbxSystemUnit toUnits)
            {
                // Get scale factor.
                float scaleFactor = 1.0f;

                scaleFactor = (float)fbxScene.GetGlobalSettings().GetSystemUnit().GetConversionFactorTo(toUnits);

                if (scaleFactor.Equals(1.0f))
                {
                    return;
                }

                // Get root node.
                FbxNode fbxRootNode = fbxScene.GetRootNode();

                // For all the nodes to convert the translations
                Queue <FbxNode> fbxNodes = new Queue <FbxNode> ();

                fbxNodes.Enqueue(fbxRootNode);

                while (fbxNodes.Count > 0)
                {
                    FbxNode fbxNode = fbxNodes.Dequeue();

                    // Convert node's translation.
                    FbxDouble3 lclTrs = fbxNode.LclTranslation.Get();

#if UNI_18844
                    lclTrs *= scaleFactor;
                    lclTrs *= scaleFactor;
                    lclTrs *= scaleFactor;
#endif
                    fbxNode.LclTranslation.Set(lclTrs);

                    FbxMesh fbxMesh = fbxNode.GetMesh();

                    if (fbxMesh != null)
                    {
                        for (int i = 0; i < fbxMesh.GetControlPointsCount(); ++i)
                        {
                            FbxVector4 fbxVector4 = fbxMesh.GetControlPointAt(i);
#if UNI_18844
                            fbxVector4 *= scaleFactor;
#endif
                            fbxMesh.SetControlPointAt(fbxVector4, i);
                        }
                    }

                    for (int i = 0; i < fbxNode.GetChildCount(); ++i)
                    {
                        fbxNodes.Enqueue(fbxNode.GetChild(i));
                    }
                }
            }
Esempio n. 24
0
    public static FbxDouble3 ConvertToFbxPos(Vector3 Vector)
    {
        FbxDouble3 Out = new FbxDouble3();

        Out.setDataValue(0, Vector[2]);
        Out.setDataValue(1, -Vector[0]);
        Out.setDataValue(2, Vector[1]);
        //Out.at(0) = Vector[0];
        //Out[0] = Vector[0];
        //Out[1] = -Vector[1];
        //Out[2] = Vector[2];
        return(Out);
    }
Esempio n. 25
0
        public void TestBasics()
        {
            FbxDouble3 v;

            // make sure the no-arg constructor doesn't crash
            new FbxDouble3();

            // Test other constructors
            v = new FbxDouble3(1, 2, 3);
            var u = new FbxDouble3(v);

            Assert.AreEqual(v, u);
            u[0] = 5;
            Assert.AreEqual(5, u[0]);
            Assert.AreEqual(1, v[0]); // check that setting u doesn't set v
            var w = new FbxDouble3(3);

            Assert.AreEqual(3, w[0]);
            Assert.AreEqual(3, w[1]);
            Assert.AreEqual(3, w[2]);

            // Test operator[]
            v    = new FbxDouble3();
            v[0] = 1;
            Assert.AreEqual(1, v[0]);
            v[1] = 2;
            Assert.AreEqual(2, v[1]);
            v[2] = 3;
            Assert.AreEqual(3, v[2]);
            Assert.That(() => v[-1], Throws.Exception.TypeOf <System.ArgumentOutOfRangeException>());
            Assert.That(() => v[3], Throws.Exception.TypeOf <System.ArgumentOutOfRangeException>());
            Assert.That(() => v[-1] = 5, Throws.Exception.TypeOf <System.ArgumentOutOfRangeException>());
            Assert.That(() => v[3]  = 5, Throws.Exception.TypeOf <System.ArgumentOutOfRangeException>());

            // Test 3-argument constructor and members X/Y/Z
            v = new FbxDouble3(1, 2, 3);
            Assert.AreEqual(1, v.X);
            Assert.AreEqual(2, v.Y);
            Assert.AreEqual(3, v.Z);
            v.X = 3;
            v.Y = 4;
            v.Z = 5;
            Assert.AreEqual(3, v.X);
            Assert.AreEqual(4, v.Y);
            Assert.AreEqual(5, v.Z);
        }
Esempio n. 26
0
    public FbxNode CreateSkeleton(List <FMeshBoneInfo> boneInfos, ref List <FbxNode> BoneNodes)
    {
        if (boneInfos == null || boneInfos.Count == 0)
        {
            return(null);
        }

        for (int BoneIndex = 0; BoneIndex < boneInfos.Count; BoneIndex++)
        {
            FMeshBoneInfo CurrentBone       = boneInfos[BoneIndex];
            FbxSkeleton   SkeletonAttribute = FbxSkeleton.Create(Scene, CurrentBone.Name);
            if (BoneIndex != 0)
            {
                SkeletonAttribute.SetSkeletonType(FbxSkeleton.EType.eLimbNode);
                //SkeletonAttribute.Size.Set(1.0);
            }
            else
            {
                SkeletonAttribute.SetSkeletonType(FbxSkeleton.EType.eRoot);
                //SkeletonAttribute.Size.Set(1.0);
            }

            // Create the node
            FbxNode BoneNode = FbxNode.Create(Scene, CurrentBone.Name);
            BoneNode.SetNodeAttribute(SkeletonAttribute);

            FbxDouble3 LocalPos   = FbxDataConverter.ConvertToFbxPos(CurrentBone.BoneTransform.position);
            FbxDouble3 LocalRot   = FbxDataConverter.ConvertToFbxRot(CurrentBone.BoneTransform.rotation);
            FbxDouble3 LocalScale = FbxDataConverter.ConvertToFbxScale(CurrentBone.BoneTransform.scale);

            BoneNode.LclTranslation.Set(LocalPos);
            BoneNode.LclRotation.Set(LocalRot);
            BoneNode.LclScaling.Set(LocalScale);

            if (BoneIndex != 0)
            {
                BoneNodes[CurrentBone.ParentIndex].AddChild(BoneNode);
            }

            BoneNodes.Add(BoneNode);
        }

        return(BoneNodes[0]);
    }
Esempio n. 27
0
            /// <summary>
            /// Export GameObject's Transform component
            /// </summary>
            protected void ExportTransform(Transform unityTransform, FbxNode fbxNode)
            {
                // get local position of fbxNode (from Unity)
                UnityEngine.Vector3 unityTranslate = unityTransform.localPosition;
                UnityEngine.Vector3 unityRotate    = unityTransform.localRotation.eulerAngles;
                UnityEngine.Vector3 unityScale     = unityTransform.localScale;

                // transfer transform data from Unity to Fbx
                var fbxTranslate = new FbxDouble3(unityTranslate.x, unityTranslate.y, unityTranslate.z);
                var fbxRotate    = new FbxDouble3(unityRotate.x, unityRotate.y, unityRotate.z);
                var fbxScale     = new FbxDouble3(unityScale.x, unityScale.y, unityScale.z);

                // set the local position of fbxNode
                fbxNode.LclTranslation.Set(fbxTranslate);
                fbxNode.LclRotation.Set(fbxRotate);
                fbxNode.LclScaling.Set(fbxScale);

                return;
            }
Esempio n. 28
0
            /// <summary>
            /// Export GameObject's Transform component
            /// </summary>
            protected void ExportTransform(Transform unityTransform, FbxNode fbxNode)
            {
                // get local position of fbxNode (from Unity)
                UnityEngine.Vector3 unityTranslate = unityTransform.localPosition;
                UnityEngine.Vector3 unityRotate    = unityTransform.localRotation.eulerAngles;
                UnityEngine.Vector3 unityScale     = unityTransform.localScale;

                // transfer transform data from Unity to Fbx
                // Negating the x value of the translation, and the y and z values of the rotation
                // to convert from Unity to Maya coordinates (left to righthanded)
                var fbxTranslate = new FbxDouble3(-unityTranslate.x, unityTranslate.y, unityTranslate.z);
                var fbxRotate    = new FbxDouble3(unityRotate.x, -unityRotate.y, -unityRotate.z);
                var fbxScale     = new FbxDouble3(unityScale.x, unityScale.y, unityScale.z);

                // set the local position of fbxNode
                fbxNode.LclTranslation.Set(fbxTranslate);
                fbxNode.LclRotation.Set(fbxRotate);
                fbxNode.LclScaling.Set(fbxScale);

                return;
            }
Esempio n. 29
0
        public FbxDouble3 assign(double pValue)
        {
            FbxDouble3 ret = new FbxDouble3(FbxWrapperNativePINVOKE.FbxDouble3_assign__SWIG_0(swigCPtr, pValue), false);

            return(ret);
        }
Esempio n. 30
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FbxDouble3 obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }