FBX Import error (enum with -1 value -- e.g. as done by the babylonjs exporter from 3dsmax) #81657

Closed
opened 2020-10-12 18:27:05 +02:00 by lee · 18 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38

Blender Version
Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: blender/blender@3e85bb34d0
Worked: (newest version of Blender that worked as expected)

Short description of error
I try and import an FBX I have exported from 3ds max 2021, but get the following traceback error.
It is weird because I could import the same geometry from max last week and it worked fine.
I can export a cube from max as an fbx, and that imports fine.

Traceback (most recent call last):
  File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\__init__.py", line 216, in execute
    if import_fbx.load(self, context, filepath=path, **keywords) == {'FINISHED'}:
  File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 2608, in load
    _(); del _
  File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 2607, in _
    fbx_item[1] = blen_read_material(fbx_tmpl, fbx_obj, settings)
  File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 1468, in blen_read_material
    blen_read_custom_properties(fbx_obj, ma, settings)
  File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 372, in blen_read_custom_properties
    assert(val >= 0 and val < len(enum_items))
AssertionError

location: <unknown location>:-1

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]
Import the attached fbx filename SeatbeltAdult_GeoBake_Environment_02.fbx

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38 **Blender Version** Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: `blender/blender@3e85bb34d0` Worked: (newest version of Blender that worked as expected) **Short description of error** I try and import an FBX I have exported from 3ds max 2021, but get the following traceback error. It is weird because I could import the same geometry from max last week and it worked fine. I can export a cube from max as an fbx, and that imports fine. ``` Traceback (most recent call last): File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\__init__.py", line 216, in execute if import_fbx.load(self, context, filepath=path, **keywords) == {'FINISHED'}: File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 2608, in load _(); del _ File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 2607, in _ fbx_item[1] = blen_read_material(fbx_tmpl, fbx_obj, settings) File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 1468, in blen_read_material blen_read_custom_properties(fbx_obj, ma, settings) File "D:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\io_scene_fbx\import_fbx.py", line 372, in blen_read_custom_properties assert(val >= 0 and val < len(enum_items)) AssertionError location: <unknown location>:-1 ``` **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)] Import the attached fbx file[name ](URL)[SeatbeltAdult_GeoBake_Environment_02.fbx](https://archive.blender.org/developer/F8983057/SeatbeltAdult_GeoBake_Environment_02.fbx)
Author

Added subscriber: @lee_sfs

Added subscriber: @lee_sfs

blender/blender#91062 was marked as duplicate of this issue

blender/blender#91062 was marked as duplicate of this issue

#83501 was marked as duplicate of this issue

#83501 was marked as duplicate of this issue
Member

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

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

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

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

There is a prop definition in that FBX called babylonTransparencyMode with possible Values ['Opaque', 'Cutoff', 'Blend']
Now the actual value on Material("seatbeltad_env_mat1") is -1, so what should the code do? It can only be 0 ('Opaque'), 1('Cutoff') or 2('Blend')...

I assume this is for babylon.js somehow? Are you adding these in Max "by hand"? Or is this some kind of special exporter?

Could it be that the Exporter does something wrong here?

There is a prop definition in that FBX called `babylonTransparencyMode` with possible Values ['Opaque', 'Cutoff', 'Blend'] Now the actual value on Material("seatbeltad_env_mat1") is -1, so what should the code do? It can only be 0 ('Opaque'), 1('Cutoff') or 2('Blend')... I assume this is for babylon.js somehow? Are you adding these in Max "by hand"? Or is this some kind of special exporter? Could it be that the Exporter does something wrong here?
Philipp Oeser changed title from FBX Import error, (Not Binary Fix) to FBX Import error (enum with -1 value) 2020-10-13 10:42:21 +02:00
Author

Thanks for your help on this guys.

So I installed the Babylon Exporter (v20200917.1) for 3ds max 2021 late last week, so this must be what has caused the new issue.

If you have a physical material applied to the geometry, there is a babylon setting where you can define, Opaque, Cutoff or Blend. I have it set to Opaque which is when the issues are caused.
If I set it to Cutoff or Blend, then it imports fine.

I have attached the Cutoff and Blend files, to see if they are giving the correct values.

Also if I apply a PBR shader, then it exports fine too.SeatbeltAdult_GeoBake_Environment_02_cutoff.fbx

SeatbeltAdult_GeoBake_Environment_02_blend.fbx

PhysicalMaterial_BabylonSettings.jpg

Thanks for your help on this guys. So I installed the Babylon Exporter (v20200917.1) for 3ds max 2021 late last week, so this must be what has caused the new issue. If you have a physical material applied to the geometry, there is a babylon setting where you can define, Opaque, Cutoff or Blend. I have it set to Opaque which is when the issues are caused. If I set it to Cutoff or Blend, then it imports fine. I have attached the Cutoff and Blend files, to see if they are giving the correct values. Also if I apply a PBR shader, then it exports fine too.[SeatbeltAdult_GeoBake_Environment_02_cutoff.fbx](https://archive.blender.org/developer/F8985729/SeatbeltAdult_GeoBake_Environment_02_cutoff.fbx) [SeatbeltAdult_GeoBake_Environment_02_blend.fbx](https://archive.blender.org/developer/F8985728/SeatbeltAdult_GeoBake_Environment_02_blend.fbx) ![PhysicalMaterial_BabylonSettings.jpg](https://archive.blender.org/developer/F8985733/PhysicalMaterial_BabylonSettings.jpg)
Author

Is there any update on this issue guys.

Aware that it is probably the Babylon exporter in max that is causing this issue, so I have filed a bug on their forum too.
Wasn't sure if there is a way to convert a -1 value to 0?
As having to change every material type when exporting to fbx is a pain.

Merci

Is there any update on this issue guys. Aware that it is probably the Babylon exporter in max that is causing this issue, so I have filed a bug on their forum too. Wasn't sure if there is a way to convert a -1 value to 0? As having to change every material type when exporting to fbx is a pain. Merci
Member

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

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

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

Changed status from 'Needs Triage' to: 'Archived'
Philipp Oeser self-assigned this 2020-11-18 13:44:56 +01:00
Member

In #81657#1035679, @lee_sfs wrote:
Aware that it is probably the Babylon exporter in max that is causing this issue, so I have filed a bug on their forum too.

For reference, I think you are talking about this:
https://forum.babylonjs.com/t/transparency-mode-blender-import-issue/14968

And yes, I would say there is not much blender can do here.

Please continue the thread on forum.babylonjs.com, you could also link them to this reports so they can see our findings regarding the "faulty" babylonTransparencyMode enum.
Thx again reporting, but I am afraid we have to close this.

> In #81657#1035679, @lee_sfs wrote: > Aware that it is probably the Babylon exporter in max that is causing this issue, so I have filed a bug on their forum too. For reference, I think you are talking about this: https://forum.babylonjs.com/t/transparency-mode-blender-import-issue/14968 And yes, I would say there is not much blender can do here. Please continue the thread on forum.babylonjs.com, you could also link them to this reports so they can see our findings regarding the "faulty" `babylonTransparencyMode` enum. Thx again reporting, but I am afraid we have to close this.
Philipp Oeser changed title from FBX Import error (enum with -1 value) to FBX Import error (enum with -1 value -- e.g. as done by the babylonjs exporter from 3dsmax) 2021-03-16 11:23:07 +01:00
Member

Added subscriber: @KevinBuysse

Added subscriber: @KevinBuysse
Member

Added subscriber: @mrlooi

Added subscriber: @mrlooi

This issue was referenced by 770d08b71f

This issue was referenced by 770d08b71f6bca3f7b3ab36b65469b571f859d60

This issue was referenced by 2fe7db7171

This issue was referenced by 2fe7db71710f0f1c53f590b1d75654121e32523b

This issue was referenced by 4e30cfd306

This issue was referenced by 4e30cfd30603c3bd8e4f7ecdea77cc65ec213d3a
Member

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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#81657
No description provided.