Example #1
0
        public FbxLayerContainer GetOwner()
        {
            global::System.IntPtr cPtr = FbxWrapperNativePINVOKE.FbxLayerElement_GetOwner(swigCPtr);
            FbxLayerContainer     ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerContainer(cPtr, false);

            return(ret);
        }
Example #2
0
        public new static FbxLayerContainer Create(FbxObject pContainer, string pName)
        {
            global::System.IntPtr cPtr = fbx_wrapperPINVOKE.FbxLayerContainer_Create__SWIG_1(FbxObject.getCPtr(pContainer), pName);
            FbxLayerContainer     ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerContainer(cPtr, false);

            return(ret);
        }
        public new static FbxLayerContainer Create(FbxManager pManager, string pName)
        {
            global::System.IntPtr cPtr = FbxWrapperNativePINVOKE.FbxLayerContainer_Create__SWIG_0(FbxManager.getCPtr(pManager), pName);
            FbxLayerContainer     ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerContainer(cPtr, false);

            return(ret);
        }
Example #4
0
        public FbxLayerElement GetLayerElement(FbxLayerContainer pContainer)
        {
            global::System.IntPtr cPtr = fbx_wrapperPINVOKE.FbxLayerEntryView_GetLayerElement__SWIG_1(swigCPtr, FbxLayerContainer.getCPtr(pContainer));
            FbxLayerElement       ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerElement(cPtr, false);

            return(ret);
        }
Example #5
0
        public static FbxLayerElementSmoothing Create(FbxLayerContainer pOwner, string pName)
        {
            global::System.IntPtr    cPtr = FbxWrapperNativePINVOKE.FbxLayerElementSmoothing_Create(FbxLayerContainer.getCPtr(pOwner), pName);
            FbxLayerElementSmoothing ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerElementSmoothing(cPtr, false);

            return(ret);
        }
        public static FbxLayerElementCrease Create(FbxLayerContainer pOwner, string pName)
        {
            global::System.IntPtr cPtr = fbx_wrapperPINVOKE.FbxLayerElementCrease_Create(FbxLayerContainer.getCPtr(pOwner), pName);
            FbxLayerElementCrease ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerElementCrease(cPtr, false);

            return(ret);
        }
Example #7
0
 public bool Equals(FbxLayerContainer other)
 {
     if (object.ReferenceEquals(other, null))
     {
         return(false);
     }
     return(this.swigCPtr.Handle.Equals(other.swigCPtr.Handle));
 }
Example #8
0
        public static FbxLayerElementUserData Create(FbxLayerContainer pOwner, string pName, int pId, SWIGTYPE_p_FbxArrayT_FbxDataType_t pDataTypes, SWIGTYPE_p_FbxArrayT_char_const_p_t pDataNames)
        {
            global::System.IntPtr   cPtr = FbxWrapperNativePINVOKE.FbxLayerElementUserData_Create__SWIG_0(FbxLayerContainer.getCPtr(pOwner), pName, pId, SWIGTYPE_p_FbxArrayT_FbxDataType_t.getCPtr(pDataTypes), SWIGTYPE_p_FbxArrayT_char_const_p_t.getCPtr(pDataNames));
            FbxLayerElementUserData ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerElementUserData(cPtr, false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public static FbxLayerElementVertexColor Create(FbxLayerContainer pOwner, string pName)
        {
            global::System.IntPtr      cPtr = NativeMethods.FbxLayerElementVertexColor_Create(FbxLayerContainer.getCPtr(pOwner), pName);
            FbxLayerElementVertexColor ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerElementVertexColor(cPtr, false);

            if (NativeMethods.SWIGPendingException.Pending)
            {
                throw NativeMethods.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #10
0
        public new static FbxLayerContainer Create(FbxObject pContainer, string pName)
        {
            global::System.IntPtr cPtr = NativeMethods.FbxLayerContainer_Create__SWIG_1(FbxObject.getCPtr(pContainer), pName);
            FbxLayerContainer     ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerContainer(cPtr, false);

            if (NativeMethods.SWIGPendingException.Pending)
            {
                throw NativeMethods.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #11
0
        public static FbxLayerElementUserData Create(FbxLayerContainer pOwner, FbxLayerElementUserData pOther)
        {
            global::System.IntPtr   cPtr = FbxWrapperNativePINVOKE.FbxLayerElementUserData_Create__SWIG_1(FbxLayerContainer.getCPtr(pOwner), FbxLayerElementUserData.getCPtr(pOther));
            FbxLayerElementUserData ret  = (cPtr == global::System.IntPtr.Zero) ? null : new FbxLayerElementUserData(cPtr, false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public void TestCreate()
        {
            var obj = CreateObject("MyObject");

            Assert.IsInstanceOf <T> (obj);

            // test null container
            Assert.That(() => { CreateObject((FbxLayerContainer)null, "MyObject"); }, Throws.Exception.TypeOf <System.ArgumentNullException>());

            // test null name
            CreateObject((string)null);

            // test zombie
            var layerContainer = FbxLayerContainer.Create(m_fbxManager, "");

            layerContainer.Destroy();
            Assert.That(() => { CreateObject(layerContainer, "MyObject"); }, Throws.Exception.TypeOf <System.ArgumentNullException>());
        }
Example #13
0
        protected override FbxMesh GenerateFbx()
        {
            string meshName = (Souls.meshRoot != null ? Souls.meshRoot.Name : "") + "_Mesh";

            FbxMesh mesh = FbxMesh.Create(Scene, meshName);

            mesh.InitControlPoints(Souls.mesh.Vertices.Count);

            int layerIndex = mesh.CreateLayer();

            FbxLayer layer = mesh.GetLayer(layerIndex);

            FbxLayerContainer layerContainer = FbxLayerContainer.Create(Scene, meshName + "_LayerContainer");

            FbxLayerElementUV uv = FbxLayerElementUV.Create(layerContainer, "Diffuse");

            layer.SetUVs(uv);

            FbxLayerElementNormal normal = FbxLayerElementNormal.Create(layerContainer, "Normal");

            layer.SetNormals(normal);
            normal.SetReferenceMode(FbxLayerElement.EReferenceMode.eDirect);
            normal.SetMappingMode(FbxLayerElement.EMappingMode.eByControlPoint);

            FbxLayerElementBinormal binormal = FbxLayerElementBinormal.Create(layerContainer, "Binormal");

            layer.SetBinormals(binormal);

            FbxLayerElementTangent tangent = FbxLayerElementTangent.Create(layerContainer, "Tangent");

            layer.SetTangents(tangent);
            tangent.SetReferenceMode(FbxLayerElement.EReferenceMode.eDirect);
            tangent.SetMappingMode(FbxLayerElement.EMappingMode.eByControlPoint);

            for (int vertexIndex = 0; vertexIndex < Souls.mesh.Vertices.Count; ++vertexIndex)
            {
                FLVER.Vertex vertex = Souls.mesh.Vertices[vertexIndex];

                Vector3 position = vertex.Position;

                // this fixes vertex positions since otherwise the model is turned inside out
                // and it appears like it holds weapons in the left hand
                position.Z = -position.Z;

                normal.GetDirectArray().Add(vertex.Normal.ToFbxVector4());

                tangent.GetDirectArray().Add(new FbxVector4(vertex.Tangents[0].X, vertex.Tangents[0].Y, vertex.Tangents[0].Z));

                Vector2 uvValue = new Vector2(0);

                if (vertex.UVs.Count > 0)
                {
                    uvValue.X = vertex.UVs[0].X;
                    uvValue.Y = vertex.UVs[0].Y;
                }

                uv.GetDirectArray().Add(uvValue.ToFbxVector2());

                mesh.SetControlPointAt(position.ToFbxVector4(), vertexIndex);
            }

            for (int faceSetIndex = 0; faceSetIndex < Souls.mesh.FaceSets.Count; ++faceSetIndex)
            {
                FLVER2.FaceSet faceSet = Souls.mesh.FaceSets[faceSetIndex];

                if (faceSet.Flags != FLVER2.FaceSet.FSFlags.None)
                {
                    continue;
                }

                for (int faceStartIndex = 0; faceStartIndex < faceSet.Indices.Count; faceStartIndex += 3)
                {
                    mesh.AddCompletePolygon(
                        faceSet.Indices[faceStartIndex],
                        faceSet.Indices[faceStartIndex + 1],
                        faceSet.Indices[faceStartIndex + 2]
                        );
                    //mesh.AddCompletePolygon(
                    //    faceSet.Indices[faceStartIndex + 2],
                    //    faceSet.Indices[faceStartIndex + 1],
                    //    faceSet.Indices[faceStartIndex]
                    //);
                }
            }

            mesh.BuildMeshEdgeArray();

            FbxGeometryConverter converter = new FbxGeometryConverter(Scene.GetFbxManager());

            converter.ComputeEdgeSmoothingFromNormals(mesh);
            converter.ComputePolygonSmoothingFromEdgeSmoothing(mesh);

            return(mesh);
        }
Example #14
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FbxLayerContainer obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #15
0
 public virtual void SetOwner(FbxLayerContainer pOwner, int pInstance)
 {
     fbx_wrapperPINVOKE.FbxLayerElementMaterial_SetOwner__SWIG_0(swigCPtr, FbxLayerContainer.getCPtr(pOwner), pInstance);
 }
Example #16
0
 public void SetContainer(FbxLayerContainer pContainer)
 {
     FbxWrapperNativePINVOKE.FbxLayerElementMaterial_LayerElementArrayProxy_SetContainer__SWIG_1(swigCPtr, FbxLayerContainer.getCPtr(pContainer));
 }
Example #17
0
 public virtual void SetOwner(FbxLayerContainer pOwner)
 {
     FbxWrapperNativePINVOKE.FbxLayerElementMaterial_SetOwner__SWIG_1(swigCPtr, FbxLayerContainer.getCPtr(pOwner));
 }
Example #18
0
 public void SetContainer(FbxLayerContainer pContainer, int pInstance)
 {
     fbx_wrapperPINVOKE.FbxLayerElementMaterial_LayerElementArrayProxy_SetContainer__SWIG_0(swigCPtr, FbxLayerContainer.getCPtr(pContainer), pInstance);
 }
 public virtual void Init()
 {
     m_fbxManager   = FbxManager.Create();
     LayerContainer = FbxLayerContainer.Create(m_fbxManager, "layer container");
 }
 /* Create an object with another layer container. Default implementation uses
  * reflection to call T.Create(...); override if reflection is wrong. */
 public virtual T CreateObject(FbxLayerContainer layerContainer, string name = "")
 {
     return(Invoker.InvokeStatic <T>(s_createFromLayerContainerAndName, layerContainer, name));
 }