FBX export and import produce incompatible texture mapping type #100391

Open
opened 2022-08-13 19:15:26 +02:00 by Andrej · 11 comments
Contributor

Simplified Report

If one FBX exports an object with a material containing a single texture scaled by a factor of 2, the FBX file will be exported with the texture inverse scale of 1 /2 = 0.5.
If that same FBX is imported back into Blender, it will be imported with the original scale by taking the inverse 1 / 0.5 = 2. However, the texture mapping node will be set to "Texture", and not the standard "Point" texture mapping model. Consequently, taking the inverse in this case is redundant, or the other way around, that is, setting the texture mapping node to "Texture" is redundant.

Furthermore, the user reporter suggests that inverse scaling is not standard in all software, so ideally, there would be an option to export as inversed or not.

Original Report

By default FBX Exporter in Blender inverses UV scaling which can cause errors in some other 3d software.

I guess inverting scaling means that exporter assumes that 3d software that would use that fbx has uv scaling opposite to Blender one but it's not true (Blender uses Point type mapping and other type that is used for fbx is Texture mapping).

For example, 3ds max UV scaling works the same way as in Blender - it uses Point type scaling, meaning increasing scales -> zooming texture out (which is different from for example Houdini where increased scales means zooming in).

Other problem is that after exporting fbx back to blender scaling are inverted back again and in shader graph mapping node has type = Texture. Meaning scale on material is kind of inversed twice meaning it now has incorrect values.
It would be more reasonable to set it's mapping type on node to Point because 1) Blender uses it as default; 2) Blender inverses input fbx texture tiling - so it's kind of converted to "Point" tiling already.

Scales in Blender (you can inverse scales by using Texture mapping instead of Point):
blender_evcpJO2RJ3.png

Resulting scales in FBX
NtiSYVM.png

Texture mapping type after FBX remport:
blender_YXjYKKCTQW.png

Suggestions to solve the problem:

  1. Add option for fbx exporter to inverse texture uv scaling and set it as default since most software probably do use inversed scaling.
  2. Add similar option to fbx importer;
  3. Set mapping nodes imported from fbx type as Point instead of Texture.
### Simplified Report If one FBX exports an object with a material containing a single texture scaled by a factor of 2, the FBX file will be exported with the texture inverse scale of 1 /2 = 0.5. If that same FBX is imported back into Blender, it will be imported with the original scale by taking the inverse 1 / 0.5 = 2. However, the texture mapping node will be set to "Texture", and not the standard "Point" texture mapping model. Consequently, taking the inverse in this case is redundant, or the other way around, that is, setting the texture mapping node to "Texture" is redundant. Furthermore, the user reporter suggests that inverse scaling is not standard in all software, so ideally, there would be an option to export as inversed or not. ### Original Report By default FBX Exporter in Blender inverses UV scaling which can cause errors in some other 3d software. I guess inverting scaling means that exporter assumes that 3d software that would use that fbx has uv scaling opposite to Blender one but it's not true (Blender uses Point type mapping and other type that is used for fbx is Texture mapping). For example, 3ds max UV scaling works the same way as in Blender - it uses Point type scaling, meaning increasing scales -> zooming texture out (which is different from for example Houdini where increased scales means zooming in). Other problem is that after exporting fbx back to blender scaling are inverted back again and in shader graph mapping node has type = Texture. Meaning scale on material is kind of inversed twice meaning it now has incorrect values. It would be more reasonable to set it's mapping type on node to Point because 1) Blender uses it as default; 2) Blender inverses input fbx texture tiling - so it's kind of converted to "Point" tiling already. Scales in Blender (you can inverse scales by using Texture mapping instead of Point): ![blender_evcpJO2RJ3.png](https://archive.blender.org/developer/F13379281/blender_evcpJO2RJ3.png) Resulting scales in FBX ![NtiSYVM.png](https://archive.blender.org/developer/F13379272/NtiSYVM.png) Texture mapping type after FBX remport: ![blender_YXjYKKCTQW.png](https://archive.blender.org/developer/F13379709/blender_YXjYKKCTQW.png) Suggestions to solve the problem: 1) Add option for fbx exporter to inverse texture uv scaling and set it as default since most software probably do use inversed scaling. 2) Add similar option to fbx importer; 3) Set mapping nodes imported from fbx type as Point instead of Texture.
Author
Contributor

Added subscriber: @Andrej-4

Added subscriber: @Andrej-4
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Omar Emara changed title from FBX Export/Import - no option not to inverse UV scaling causes errors to FBX export and import produce incompatible texture mapping scale 2022-08-16 13:40:22 +02:00
Bastien Montagne changed title from FBX export and import produce incompatible texture mapping scale to FBX export and import produce incompatible texture mapping type 2022-10-07 12:44:41 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

Talked to Brecht about this... FBX has no clear specs about what is expected here, however since that scale factor is stored in texture data there, I think we can assume it to be the equivalent of the 'Texture' option in Blender's mapping node (aka scaling the image, and not the texture coordinates).

So think what we should do is:

  • On export, check whether Texture or Point mode is used, if the later is, invert the scaling values. (Currently there is no such check, and scaling values are always inverted.)
  • On import, always set the mapping type to 'Texture' (as already done), and do not invert the scaling values. (Currently 'Texture' type is always set, but scaling values are still inverted.)

Does that makes sense to you guys?

Talked to Brecht about this... FBX has no clear specs about what is expected here, however since that scale factor is stored in texture data there, I think we can assume it to be the equivalent of the 'Texture' option in Blender's mapping node (aka scaling the image, and not the texture coordinates). So think what we should do is: * On export, check whether `Texture` or `Point` mode is used, if the later is, invert the scaling values. *(Currently there is no such check, and scaling values are always inverted.)* * On import, always set the mapping type to 'Texture' (as already done), and do not invert the scaling values. *(Currently 'Texture' type is always set, but scaling values are still inverted.)* Does that makes sense to you guys?

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

This comment was removed by @mont29

*This comment was removed by @mont29*
Author
Contributor

In #100391#1429180, @mont29 wrote:
Talked to Brecht about this... FBX has no clear specs about what is expected here, however since that scale factor is stored in texture data there, I think we can assume it to be the equivalent of the 'Texture' option in Blender's mapping node (aka scaling the image, and not the texture coordinates).

So think what we should do is:

  • On export, check whether Texture or Point mode is used, if the later is, invert the scaling values. (Currently there is no such check, and scaling values are always inverted.)
  • On import, always set the mapping type to 'Texture' (as already done), and do not invert the scaling values. (Currently 'Texture' type is always set, but scaling values are still inverted.)

Does that makes sense to you guys?

Sounds good for the most cases but the little flaw is that there will be no option to export/import Point mode scales in fbx (which is used in 3ds max for example).
The solution would be to add an option on import/export wheither to use Point mode UV scales or not and set it false as default since most editors with fbx seems to use Texture mode.

> In #100391#1429180, @mont29 wrote: > Talked to Brecht about this... FBX has no clear specs about what is expected here, however since that scale factor is stored in texture data there, I think we can assume it to be the equivalent of the 'Texture' option in Blender's mapping node (aka scaling the image, and not the texture coordinates). > > So think what we should do is: > * On export, check whether `Texture` or `Point` mode is used, if the later is, invert the scaling values. *(Currently there is no such check, and scaling values are always inverted.)* > * On import, always set the mapping type to 'Texture' (as already done), and do not invert the scaling values. *(Currently 'Texture' type is always set, but scaling values are still inverted.)* > > Does that makes sense to you guys? Sounds good for the most cases but the little flaw is that there will be no option to export/import Point mode scales in fbx (which is used in 3ds max for example). The solution would be to add an option on import/export wheither to use Point mode UV scales or not and set it false as default since most editors with fbx seems to use Texture mode.

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

It seems this was mistaken with another report and its status was changed from confirmed, so changing back.

It seems this was mistaken with another report and its status was changed from confirmed, so changing back.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#100391
No description provided.