Can not import .obj or .fbx generated from Marvelous Designer #53841

Closed
opened 2018-01-20 00:21:57 +01:00 by yifei · 16 comments

System Information
windows 10 , gtx 1060

Blender Version
Broken: 2.79 42a5624

Short description of error
as title,
here is the error information

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\__init__.py", line 234, in execute
    return import_fbx.load(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 2463, in load
    _(); del _
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 2462, in _
    fbx_item[1] = blen_read_geom(fbx_tmpl, fbx_obj, settings)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 1131, in blen_read_geom
    elem_name_utf8 = elem_name_ensure_class(fbx_obj, b'Geometry')
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 127, in elem_name_ensure_class
    return elem_name.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 6: invalid start byte

location: <unknown location>:-1


importing .obj file gives similar error.
Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

**System Information** windows 10 , gtx 1060 **Blender Version** Broken: 2.79 42a5624 **Short description of error** as title, here is the error information ``` Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\__init__.py", line 234, in execute return import_fbx.load(self, context, **keywords) File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 2463, in load _(); del _ File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 2462, in _ fbx_item[1] = blen_read_geom(fbx_tmpl, fbx_obj, settings) File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 1131, in blen_read_geom elem_name_utf8 = elem_name_ensure_class(fbx_obj, b'Geometry') File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_scene_fbx\import_fbx.py", line 127, in elem_name_ensure_class return elem_name.decode('utf-8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 6: invalid start byte location: <unknown location>:-1 ``` importing .obj file gives similar error. **Exact steps for others to reproduce the error** Based on a (as simple as possible) attached .blend file with minimum amount of steps
Author

Added subscriber: @yifei

Added subscriber: @yifei
Author
[katou-和服.fbx](https://archive.blender.org/developer/F1900550/katou-和服.fbx)

Added subscriber: @ArtoKitula

Added subscriber: @ArtoKitula

Could you add obj file instead of fbx?

Could you add obj file instead of fbx?

Added subscriber: @cyaoeu

Added subscriber: @cyaoeu

As a temporary workaround you can change line 127 and forward in import_fbx.py (see the path of the error) to this:

    try:
        return elem_name.decode('utf-8')
    except UnicodeDecodeError:
        return str(elem_name)  # utf-8 couldn't be decoded, export garbled name instead of failing
As a temporary workaround you can change line 127 and forward in import_fbx.py (see the path of the error) to this: ``` try: return elem_name.decode('utf-8') except UnicodeDecodeError: return str(elem_name) # utf-8 couldn't be decoded, export garbled name instead of failing ```
Author

katou-和服.obj this is the .obj file

[katou-和服.obj](https://archive.blender.org/developer/F1901374/katou-和服.obj) this is the .obj file
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

@cyaoeu : thanx for investigating
how about {D3012}?

@cyaoeu : thanx for investigating how about {[D3012](https://archive.blender.org/developer/D3012)}?
Member

OBJ importer works for me though (it is using above method - using a replacement character - already btw...)

OBJ importer works for me though (it is using above method - using a replacement character - already btw...)
Bastien Montagne was assigned by Philipp Oeser 2018-01-20 12:14:27 +01:00

Regarding OBJ file, I guess we have no issues here because we do not have the MTL file associated with it (its path is the only textual info in an OBJ file I think…).

FBX is another topic, as stated by the official doc, FBX uses utf8 unicode encoding internally. This means that that FBX file is seriously broken imho. Will add the 'replace' option from D3012, won't hurt probably, but this should absolutely not be needed. At all. Suggest you report the issue to Marvelous Designer team (and as a side question, does this FBX file loads OK in e.g. Maya or 3DSMax?).

Regarding OBJ file, I guess we have no issues here because we do not have the MTL file associated with it (its path is the only textual info in an OBJ file I think…). FBX is another topic, as stated by [the official doc](http://help.autodesk.com/view/FBX/2017/ENU/?guid=__files_GUID_D3844B1D_4E74_4C64_AD79_14B00EB1FE4C_htm), FBX uses utf8 unicode encoding internally. This means that that FBX file is seriously broken imho. Will add the 'replace' option from [D3012](https://archive.blender.org/developer/D3012), won't hurt probably, but this should absolutely not be needed. At all. Suggest you report the issue to Marvelous Designer team (and as a side question, does this FBX file loads OK in e.g. Maya or 3DSMax?).

This issue was referenced by 5804465558

This issue was referenced by 5804465558100a079aa19680928824d2dbcdd63f

This issue was referenced by 29ae03c572

This issue was referenced by 29ae03c572bda6278f5a515eb56f6bdd27296c1a

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

I dont have maya or 3ds max. this fbx is ok with windows 3d painter and daz studio. I tried to open in daz and save again to work around but it introduced some daz studio things not needed. I suspect that the reason it cannot be opened in blender is that I put chinese character in file name when I saved it in marvelous designer. Marvelous Designer uses fbx sdk, it should be ok with maya and 3ds max in my opinion.

I dont have maya or 3ds max. this fbx is ok with windows 3d painter and daz studio. I tried to open in daz and save again to work around but it introduced some daz studio things not needed. I suspect that the reason it cannot be opened in blender is that I put chinese character in file name when I saved it in marvelous designer. Marvelous Designer uses fbx sdk, it should be ok with maya and 3ds max in my opinion.

Then it means that FBX SDK does not even respect its own documentation (what a surprise…)

Anyway, fix is committed, Blender shall now be resilient to badly encoded strings.

Btw, Chinese characters are not an issue in themselves, here issue is that the strings are not encoded in valid utf8 as expected (no idea what's used instead, could be some Windows-specific Chinese encoding …).

Then it means that FBX SDK does not even respect its own documentation (what a surprise…) Anyway, fix is committed, Blender shall now be resilient to badly encoded strings. Btw, Chinese characters are not an issue in themselves, here issue is that the strings are not encoded in valid utf8 as expected (no idea what's used instead, could be some Windows-specific Chinese encoding …).
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 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#53841
No description provided.