Skip to content

Commit 1cb7e24

Browse files
committed
Fix FBX shape naming for blendshapes
If the name of a FbxShape backing a blendshape channel is left as an empty string, multiple blend shapes on the same object fail to export properly. Only the last blendshape modifier is used, regardless of which is enabled. This fixes it.
1 parent 005696c commit 1cb7e24

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

com.unity.formats.fbx/Editor/FbxExporter.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,14 @@ private bool ExportBlendShapes(MeshInfo mesh, FbxMesh fbxMesh, FbxScene fbxScene
498498
var weight = umesh.GetBlendShapeFrameWeight(bi, fi);
499499
umesh.GetBlendShapeFrameVertices(bi, fi, deltaPoints, deltaNormals, deltaTangents);
500500

501-
var fbxShape = FbxShape.Create(fbxScene, "");
501+
var fbxShapeName = bsName;
502+
503+
if (numFrames > 1)
504+
{
505+
fbxShapeName += "_" + fi;
506+
}
507+
508+
var fbxShape = FbxShape.Create(fbxScene, fbxShapeName);
502509
fbxChannel.AddTargetShape(fbxShape, weight);
503510

504511
// control points

0 commit comments

Comments
 (0)