Maniphest T96858

FBX Exporter: Incorrect 'Type' field in material 'Mapping' node
Confirmed, NormalBUG

Assigned To
None
Authored By
Felix Herbst (herbst)
Mar 29 2022, 5:20 PM
Tags
  • Add-ons (BF-Blender)
  • Import/Export
Subscribers
Felix Herbst (herbst)
Germano Cavalcante (mano-wii)

Description

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.15

Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash: rBc77597cd0e15

Short description of error
Export and import a FBX with a simple material with a texture mapping results in incorrect tiling as the Mapping type is set to "Texture" instead of "Point" (the default).

After importing the FBX:

Expected:Result:
NOTE: Analyzing other softwares, the same result of the texture mapping is verified after importing the file. This indicates that the problem is in the exporter.
NOTE: Switching type to "Texture" and adjusting the values to 0.1,0.1,0.1 is a workaround but should not be required.

If I'm not mistaken this needs to be fixed in export_fbx_bin.py:fbx_data_texture_file_elements:1432,
elem_props_template_set(tmpl, props, "p_vector_3d", b"Scaling", (((1.0 / s) if s != 0.0 else 1.0) for s in tex.scale))
might need to take the mapping type into account.

For reference, glTF seems to do that in gltf2_blender_get.py:get_texture_transform_from_mapping_node and takes TEXTURE, POINT and VECTOR into account for calculating the texture transform.

Exact steps for others to reproduce the error

  • Open attached file or:
    • Create a cube
    • Add a material
    • Add a texture to Base Color
    • Add a UV Map node and a Mapping node, note the default type is "Point"
    • Set Scale to 10,10,10
  • Export as FBX with embedded textures
  • Open a separate Blender instance
  • Import the FBX

Note that the resulting texture tiling is effectively "inverted"

For reference:

  • Export as GLB
  • import the glTF

Note that the result is correct

Attached files:


Event Timeline

Felix Herbst (herbst) created this task.Mar 29 2022, 5:20 PM
Felix Herbst (herbst) updated the task description.
Felix Herbst (herbst) updated the task description.Mar 29 2022, 5:34 PM
Felix Herbst (herbst) updated the task description.
Felix Herbst (herbst) updated the task description.Mar 29 2022, 5:38 PM
Germano Cavalcante (mano-wii) updated the task description.Mar 30 2022, 8:24 PM
Germano Cavalcante (mano-wii) edited projects, added Add-ons (BF-Blender); removed BF Blender.
Germano Cavalcante (mano-wii) renamed this task from Exporting FBX with Mapping node set to "Point" exports incorrect texture tiling to Importing an exported FBX with 'Vector Mapping' node set to "Point" results in incorrect texture Mapping.Mar 30 2022, 8:27 PM
Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".
Germano Cavalcante (mano-wii) added a project: Import/Export.
Germano Cavalcante (mano-wii) added a subscriber: Germano Cavalcante (mano-wii).

Thanks for the report. I edited the description to be a little clearer.

Felix Herbst (herbst) added a comment.EditedMar 30 2022, 9:01 PM
In T96858#1332488, @Germano Cavalcante (mano-wii) wrote:

Thanks for the report. I edited the description to be a little clearer.

Thank you. Out of curiosity, why did you remove my remarks about this being an export bug (instead of an import bug)?

Germano Cavalcante (mano-wii) added a comment.Mar 30 2022, 9:09 PM
In T96858#1332540, @Felix Herbst (herbst) wrote:

Thank you. Out of curiosity, why did you remove my remarks about this being an export bug (instead of an import bug)?

The message was a little confusing. I read that it was "verified that the _import_ is correct ... in external softwares", but now looking back I see that I got it wrong. I will edit.

Germano Cavalcante (mano-wii) renamed this task from Importing an exported FBX with 'Vector Mapping' node set to "Point" results in incorrect texture Mapping to FBX Exporter: Incorrect 'Type' field in material 'Mapping' node.Mar 30 2022, 9:16 PM
Germano Cavalcante (mano-wii) updated the task description.