- [GUI] Improve ExportOptions.
- [GUI] Update Library. - [GUI] Fix bug in `AssetBrowser`.
This commit is contained in:
@@ -62,8 +62,6 @@ namespace AssetStudio
|
||||
public bool exportBlendShape;
|
||||
public bool castToBone;
|
||||
public int boneSize;
|
||||
public bool exportAllUvsAsDiffuseMaps;
|
||||
public bool exportUV0UV1;
|
||||
public float scaleFactor;
|
||||
public int fbxVersion;
|
||||
public int fbxFormat;
|
||||
|
||||
@@ -76,10 +76,7 @@ namespace AssetStudio.FbxInterop
|
||||
private static extern void AsFbxMeshCreateElementNormal(IntPtr mesh);
|
||||
|
||||
[DllImport(FbxDll.DllName)]
|
||||
private static extern void AsFbxMeshCreateDiffuseUV(IntPtr mesh, int uv);
|
||||
|
||||
[DllImport(FbxDll.DllName)]
|
||||
private static extern void AsFbxMeshCreateNormalMapUV(IntPtr mesh, int uv);
|
||||
private static extern void AsFbxMeshCreateUV(IntPtr mesh, int uv, int uvType);
|
||||
|
||||
[DllImport(FbxDll.DllName)]
|
||||
private static extern void AsFbxMeshCreateElementTangent(IntPtr mesh);
|
||||
|
||||
@@ -256,39 +256,12 @@ namespace AssetStudio.FbxInterop
|
||||
AsFbxMeshCreateElementNormal(mesh);
|
||||
}
|
||||
|
||||
if (_exportOptions.exportUV0UV1)
|
||||
for (int i = 0; i < importedMesh.hasUV.Length; i++)
|
||||
{
|
||||
if (importedMesh.hasUV[0])
|
||||
{
|
||||
AsFbxMeshCreateDiffuseUV(mesh, 0);
|
||||
}
|
||||
if (importedMesh.hasUV[1])
|
||||
{
|
||||
if (_exportOptions.exportAllUvsAsDiffuseMaps)
|
||||
{
|
||||
AsFbxMeshCreateDiffuseUV(mesh, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
AsFbxMeshCreateNormalMapUV(mesh, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < importedMesh.hasUV.Length; i++)
|
||||
{
|
||||
if (!importedMesh.hasUV[i]) { continue; }
|
||||
if (!importedMesh.hasUV[i]) { continue; }
|
||||
|
||||
if (i == 1 && !_exportOptions.exportAllUvsAsDiffuseMaps)
|
||||
{
|
||||
AsFbxMeshCreateNormalMapUV(mesh, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
AsFbxMeshCreateDiffuseUV(mesh, i);
|
||||
}
|
||||
}
|
||||
var type = importedMesh.uvType[i];
|
||||
AsFbxMeshCreateUV(mesh, i, type);
|
||||
}
|
||||
|
||||
if (importedMesh.hasTangent)
|
||||
@@ -391,7 +364,7 @@ namespace AssetStudio.FbxInterop
|
||||
AsFbxMeshElementNormalAdd(mesh, 0, normal.X, normal.Y, normal.Z);
|
||||
}
|
||||
|
||||
var uvSize = _exportOptions.exportUV0UV1 ? 2 : importedMesh.hasUV.Length;
|
||||
var uvSize = importedMesh.hasUV.Length;
|
||||
for (var uvIndex = 0; uvIndex < uvSize; uvIndex += 1)
|
||||
{
|
||||
if (importedMesh.hasUV[uvIndex])
|
||||
|
||||
Reference in New Issue
Block a user