public FbxArrayFbxVector2(FbxArrayFbxVector2 pArray) : this(FbxWrapperNativePINVOKE.new_FbxArrayFbxVector2__SWIG_2(FbxArrayFbxVector2.getCPtr(pArray)), true)
 {
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public void RemoveArray(FbxArrayFbxVector2 pOther)
 {
     FbxWrapperNativePINVOKE.FbxArrayFbxVector2_RemoveArray(swigCPtr, FbxArrayFbxVector2.getCPtr(pOther));
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public void AddArrayNoDuplicate(FbxArrayFbxVector2 pOther)
 {
     FbxWrapperNativePINVOKE.FbxArrayFbxVector2_AddArrayNoDuplicate(swigCPtr, FbxArrayFbxVector2.getCPtr(pOther));
     if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
     {
         throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
     }
 }
示例#4
0
        public FbxLayerElementArray assign(FbxArrayFbxVector2 pArrayTemplate)
        {
            FbxLayerElementArray ret = new FbxLayerElementArray(FbxWrapperNativePINVOKE.FbxLayerElementArrayTemplateFbxVector2_assign__SWIG_0(swigCPtr, FbxArrayFbxVector2.getCPtr(pArrayTemplate)), false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public bool eq(FbxArrayFbxVector2 pOther)
        {
            bool ret = FbxWrapperNativePINVOKE.FbxArrayFbxVector2_eq(swigCPtr, FbxArrayFbxVector2.getCPtr(pOther));

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public FbxArrayFbxVector2 assign(FbxArrayFbxVector2 pOther)
        {
            FbxArrayFbxVector2 ret = new FbxArrayFbxVector2(FbxWrapperNativePINVOKE.FbxArrayFbxVector2_assign(swigCPtr, FbxArrayFbxVector2.getCPtr(pOther)), false);

            if (FbxWrapperNativePINVOKE.SWIGPendingException.Pending)
            {
                throw FbxWrapperNativePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
示例#7
0
        void PrintAttribute(FbxManager manager, FbxNodeAttribute attri)
        {
            FbxLayerElementVertexColor pp;


            Log.Info("attri " + attri.GetName());
            Log.Info("attri type " + Enum.GetName(typeof(FbxNodeAttribute.EType), attri.GetAttributeType()));
            //attri.is

            if (attri.GetAttributeType() == FbxNodeAttribute.EType.eMesh)
            {
                Type t = attri.GetType();
                Log.Info("type name " + t.Name);

                FbxMesh mesh = attri.GetNode().GetMesh();


                //FbxMesh mesh = attri as FbxMesh;
                if (mesh == null)
                {
                    Log.Error("convert mesh failed!");
                    return;
                }


                Console.WriteLine($"mesh.GetMeshEdgeCount() = {mesh.GetMeshEdgeCount()}; mesh.GetPolygonCount() = {mesh.GetPolygonCount()}; mesh.GetPolygonVertexCount()={mesh.GetPolygonVertexCount()}; " +
                                  $"mesh.GetTextureUVCount() {mesh.GetTextureUVCount()}; mesh.GetControlPointsCount()={mesh.GetControlPointsCount()}; mesh.GetElementTangentCount()={mesh.GetElementTangentCount()};" +
                                  $" mesh.GetElementNormalCount()={mesh.GetElementNormalCount()}; mesh.GetElementVertexColorCount()={mesh.GetElementVertexColorCount()};" +
                                  $"mesh.GetUVLayerCount() = {mesh.GetUVLayerCount()}; mesh.GetLayerCount() = {mesh.GetLayerCount()}");
                var pts = mesh.GetControlPoints();
                var ar  = FbxVector4Array.frompointer(pts);

                for (int i = 0; i < mesh.GetLayerCount(); i++)
                {
                    var layer = mesh.GetLayer(i);
                }

                try
                {
                    var v2 = new FbxVector2();

                    IntPtr mem = Marshal.AllocHGlobal(4);

                    FbxStringList lst = new FbxStringList();
                    //int nameCount = lst.GetCount();
                    mesh.GetUVSetNames(lst); //ToDo : что за List, расширяется ли он сам?
                    var name = lst.GetItemAt(0).mString.Buffer();

                    //var myBool = new _MyBool(mem);
                    //var res = mesh.GetPolygonVertexUV(0, 0, name, v2, myBool);
                    //            var c0 = v2.at(0);
                    //            var c2 = v2.at(1);

                    var    fbxArV2 = new FbxArrayFbxVector2();
                    var    fbxArI  = new FbxArrayInt();
                    var    res     = mesh.GetPolygonVertexUVs(name, fbxArV2, fbxArI);
                    var    ptr     = fbxArV2.GetAt(2).mData;
                    double coord1  = FbxWrapperNative.DoubleArrayFunc_getitem(ptr, 0);
                    double coord2  = FbxWrapperNative.DoubleArrayFunc_getitem(ptr, 1);
                    var    param   = FbxWrapperNative.new_FbxLayerElementArrayTemplateIntPtrFunc();
                    res = mesh.GetMaterialIndices(param);
                    var param2 = FbxWrapperNative.FbxLayerElementArrayTemplateIntPtrFunc_value(param);
                    int count  = param2.GetCount();

                    List <int> mind = new List <int>();
                    for (int i = 0; i < count; i++)
                    {
                        mind.Add(param2.GetAt(i));
                    }



                    //var vec = new FbxVector4Array(5);
                    //var res2 = mesh.GetPolygonVertexUVs("", , null);

                    bool res1 = mesh.GenerateTangentsData(0);
                    //bool res2 = mesh.GenerateTangentsDataForAllUVSets( );
                    var tCount = mesh.GetElementTangentCount();
                    var tang   = mesh.GetElementTangent(  );
                    var tangAr = tang.GetDirectArray();
                    int tC     = tangAr.GetCount();

                    //int binCount = mesh.GetElementBinormalCount();
                    //var bin = mesh.GetElementBinormal().GetDirectArray().GetCount();
                }
                catch (Exception ex)
                {
                }


                //var vertices =  mesh.GetPolygonVertices();

                //FbxMesh mesh;
                //FbxLayerElementUV uv = mesh.GetElementUV();

                //uv.GetDirectArray()


                FbxLayerElementNormal normal = mesh.GetElementNormal();

                //ToDo

                //DirectArrayFbxVector4 array = normal.GetDirectArray();
                var array = normal.GetDirectArray();

                Log.Info("normal count " + array.GetCount());
                //for (int i = 0; i < array.GetCount(); i++)
                //{
                //    FbxVector4 v = array.GetAt(i);
                //    SWIGTYPE_p_double data = v.mData;
                //    DoubleArray d = DoubleArray.frompointer(data);
                //    PrintDoubleArray(d, 4);
                //}
            }
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FbxArrayFbxVector2 obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }