Skip to content

Fix FBX export unit scaling - #289

Open
ProgLuis wants to merge 1 commit into
makehumancommunity:masterfrom
ProgLuis:fix/fbx-export-unit-scaling
Open

ProgLuis wants to merge 1 commit into
makehumancommunity:masterfrom
ProgLuis:fix/fbx-export-unit-scaling

Conversation

@ProgLuis

Copy link
Copy Markdown

This fixes inconsistent unit scaling in the FBX exporter.

The exporter gets the selected export scale from the common export settings, but FBX additionally multiplied that scale by 10. At the same time, the FBX unit metadata used fixed values that did not correspond to all selectable export units.

This caused the numeric coordinates and the declared FBX system unit to represent inconsistent physical dimensions depending on the selected unit.

The change:

  • removes the additional FBX-specific ×10 scale;
  • uses the scale selected by the common export settings directly;
  • calculates UnitScaleFactor as 10.0 / config.scale;
  • uses the same value for OriginalUnitScaleFactor;
  • applies the same unit metadata to both binary and ASCII FBX.

With the available export scales, this produces:

Selected unit config.scale UnitScaleFactor
meter 0.1 100
decimeter 1.0 10
centimeter 10.0 1

These values represent centimeters per FBX unit, keeping the physical dimensions consistent across all three selections.

The change was checked against both the binary and ASCII FBX header writers. It was also tested by exporting from MakeHuman 1.3.0 and importing the result into Autodesk 3ds Max configured in millimeters, where the resulting model dimensions were correct.

This change is independent of #298.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant