Example #1
0
 public void ConvertScene(FbxScene pScene, FbxSystemUnit.ConversionOptions pOptions)
 {
     NativeMethods.FbxSystemUnit_ConvertScene__SWIG_0(swigCPtr, FbxScene.getCPtr(pScene), FbxSystemUnit.ConversionOptions.getCPtr(pOptions));
     if (NativeMethods.SWIGPendingException.Pending)
     {
         throw NativeMethods.SWIGPendingException.Retrieve();
     }
 }
Example #2
0
 public void ConvertScene(FbxScene pScene, FbxNode pFbxRoot, FbxSystemUnit.ConversionOptions pOptions)
 {
     FbxWrapperNativePINVOKE.FbxSystemUnit_ConvertScene__SWIG_2(swigCPtr, FbxScene.getCPtr(pScene), FbxNode.getCPtr(pFbxRoot), FbxSystemUnit.ConversionOptions.getCPtr(pOptions));
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #3
0
 public void ConvertChildren(FbxNode pRoot, FbxSystemUnit pSrcUnit, FbxSystemUnit.ConversionOptions pOptions)
 {
     FbxWrapperNativePINVOKE.FbxSystemUnit_ConvertChildren__SWIG_0(swigCPtr, FbxNode.getCPtr(pRoot), FbxSystemUnit.getCPtr(pSrcUnit), FbxSystemUnit.ConversionOptions.getCPtr(pOptions));
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public void ConvertScene(FbxScene pScene, FbxSystemUnit.ConversionOptions pOptions)
 {
     fbx_wrapperPINVOKE.FbxSystemUnit_ConvertScene__SWIG_0(swigCPtr, FbxScene.getCPtr(pScene), FbxSystemUnit.ConversionOptions.getCPtr(pOptions));
     if (fbx_wrapperPINVOKE.SWIGPendingException.Pending)
     {
         throw fbx_wrapperPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public void TestBasics()
        {
            // Call all the functions. Test that a few of them actually work
            // (rather than merely not crashing).
            using (FbxSystemUnit.mm) { }
            using (FbxSystemUnit.cm) { }
            using (FbxSystemUnit.dm) { }
            using (FbxSystemUnit.m) { }
            using (FbxSystemUnit.km) { }
            using (FbxSystemUnit.Inch) { }
            using (FbxSystemUnit.Foot) { }
            using (FbxSystemUnit.Yard) { }

            var units = new FbxSystemUnit(0.1);

            Assert.AreEqual(0.1, units.GetScaleFactor());
            Assert.AreEqual(1, units.GetMultiplier(), 1);
            Assert.AreEqual("mm", units.GetScaleFactorAsString());
            Assert.AreEqual(FbxSystemUnit.mm, units);
            Assert.AreNotEqual(FbxSystemUnit.km, units);
            units.GetHashCode();
            units.ToString();
            units.Dispose();

            units = new FbxSystemUnit(0.1378123891, 324823);
            units.ToString();
            Assert.AreEqual("custom unit", units.GetScaleFactorAsString(pAbbreviated: false));
            Assert.AreNotEqual(units, FbxSystemUnit.mm);

            // test GetGetConversionFactor
            Assert.AreEqual(FbxSystemUnit.cm.GetConversionFactorTo(FbxSystemUnit.Foot),
                            FbxSystemUnit.Foot.GetConversionFactorFrom(FbxSystemUnit.cm));

            // test ConversionOptions.Dispose()
            FbxSystemUnit.ConversionOptions options = new FbxSystemUnit.ConversionOptions();
            options.Dispose();

            using (var manager = FbxManager.Create()) {
                FbxScene scene = FbxScene.Create(manager, "scene");

                // test ConvertScene (make sure it doesn't crash)
                FbxSystemUnit.cm.ConvertScene(scene);
                FbxSystemUnit.m.ConvertScene(scene, new FbxSystemUnit.ConversionOptions());

                // test null
                Assert.That(() => { FbxSystemUnit.dm.ConvertScene(null); }, Throws.Exception.TypeOf <System.ArgumentNullException>());

                // test destroyed
                scene.Destroy();
                Assert.That(() => { FbxSystemUnit.dm.ConvertScene(scene); }, Throws.Exception.TypeOf <System.ArgumentNullException>());
            }
        }
        public static bool InsertFbxRoot(FbxScene pScene, FbxAxisSystem pDstAxis, FbxSystemUnit pDstUnit, FbxSystemUnit.ConversionOptions pUnitOptions)
        {
            bool ret = FbxWrapperNativePINVOKE.FbxRootNodeUtility_InsertFbxRoot__SWIG_0(FbxScene.getCPtr(pScene), FbxAxisSystem.getCPtr(pDstAxis), FbxSystemUnit.getCPtr(pDstUnit), FbxSystemUnit.ConversionOptions.getCPtr(pUnitOptions));

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }