public void SetReferenceMode(FbxLayerElement.EReferenceMode pReferenceMode)
 {
     NativeMethods.FbxLayerElement_SetReferenceMode(swigCPtr, (int)pReferenceMode);
     if (NativeMethods.SWIGPendingException.Pending)
     {
         throw NativeMethods.SWIGPendingException.Retrieve();
     }
 }
 public FbxLayerElement.EReferenceMode GetReferenceMode()
 {
     FbxLayerElement.EReferenceMode ret = (FbxLayerElement.EReferenceMode)NativeMethods.FbxLayerElement_GetReferenceMode(swigCPtr);
     if (NativeMethods.SWIGPendingException.Pending)
     {
         throw NativeMethods.SWIGPendingException.Retrieve();
     }
     return(ret);
 }
Exemple #3
0
 public new void SetReferenceMode(FbxLayerElement.EReferenceMode pMode)
 {
     FbxWrapperNativePINVOKE.FbxLayerElementSmoothing_SetReferenceMode(swigCPtr, (int)pMode);
 }
 public new void SetReferenceMode(FbxLayerElement.EReferenceMode pMode)
 {
     fbx_wrapperPINVOKE.FbxLayerElementCrease_SetReferenceMode(swigCPtr, (int)pMode);
 }
            /// <summary>
            /// Process a single UV dataset and return data for configuring a Mesh UV attribute
            /// </summary>
            private Vector2 [] ProcessUVSet(FbxLayerElementUV element,
                                            int [] polygonVertexIndices,
                                            int vertexCount)
            {
                Vector2 [] result = new Vector2 [polygonVertexIndices.Length];

                FbxLayerElement.EReferenceMode referenceMode = element.GetReferenceMode();
                FbxLayerElement.EMappingMode   mappingMode   = element.GetMappingMode();

                // direct or via-index
                bool isDirect = referenceMode == FbxLayerElement.EReferenceMode.eDirect;

                var fbxElementArray = element.GetDirectArray();
                var fbxIndexArray   = isDirect ? null : element.GetIndexArray();

                if (mappingMode == FbxLayerElement.EMappingMode.eByControlPoint)
                {
                    if (fbxElementArray.GetCount() != vertexCount)
                    {
                        Debug.LogError(string.Format("UVSet size ({0}) does not match vertex count {1}",
                                                     fbxElementArray.GetCount(), vertexCount));
                        return(null);
                    }

                    for (int i = 0; i < polygonVertexIndices.Length; i++)
                    {
                        int index = i;
                        if (!isDirect)
                        {
                            index = fbxIndexArray.GetAt(i);
                        }

                        FbxVector2 fbxVector2 = fbxElementArray.GetAt(polygonVertexIndices [index]);
                        Debug.Assert(fbxVector2.X >= float.MinValue && fbxVector2.X <= float.MaxValue);
                        Debug.Assert(fbxVector2.Y >= float.MinValue && fbxVector2.Y <= float.MaxValue);

                        result [i] = new Vector2((float)fbxVector2.X, (float)fbxVector2.Y);

                        // UVs in FBX can contain NaNs, so we set these vertices to (0,0)
                        if (float.IsNaN(result [i] [0]) || float.IsNaN(result [i] [1]))
                        {
                            Debug.LogWarning(string.Format("invalid UV detected at {0}", i));
                            result [i] = Vector2.zero;
                        }
                    }
                }
                else if (mappingMode == FbxLayerElement.EMappingMode.eAllSame)
                {
                    FbxVector2 fbxVector2 = fbxElementArray.GetAt(0);
                    Debug.Assert(fbxVector2.X >= float.MinValue && fbxVector2.X <= float.MaxValue);
                    Debug.Assert(fbxVector2.Y >= float.MinValue && fbxVector2.Y <= float.MaxValue);

                    Vector2 value = new Vector2((float)fbxVector2.X, (float)fbxVector2.Y);
                    for (int i = 0; i < polygonVertexIndices.Length; i++)
                    {
                        result [i] = value;
                    }
                }
                else
                {
                    Debug.LogError("unsupported UV-to-Component mapping mode");
                }

                return(result);
            }
 public FbxLayerElement.EReferenceMode GetReferenceMode()
 {
     FbxLayerElement.EReferenceMode ret = (FbxLayerElement.EReferenceMode)FbxWrapperNativePINVOKE.FbxLayerElement_GetReferenceMode(swigCPtr);
     return(ret);
 }
 public void SetReferenceMode(FbxLayerElement.EReferenceMode pReferenceMode)
 {
     FbxWrapperNativePINVOKE.FbxLayerElement_SetReferenceMode(swigCPtr, (int)pReferenceMode);
 }
Exemple #8
0
 public FbxLayerElement.EReferenceMode GetReferenceMode()
 {
     FbxLayerElement.EReferenceMode ret = (FbxLayerElement.EReferenceMode)fbx_wrapperPINVOKE.FbxLayerElement_GetReferenceMode(swigCPtr);
     return(ret);
 }
Exemple #9
0
 public void SetReferenceMode(FbxLayerElement.EReferenceMode pReferenceMode)
 {
     fbx_wrapperPINVOKE.FbxLayerElement_SetReferenceMode(swigCPtr, (int)pReferenceMode);
 }