Witcher 3 FBX import armature/bones/vertex weights not imported #55670

Closed
opened 2018-06-28 23:11:26 +02:00 by Hidde Jansen · 13 comments

System Information
Win10, Nvidia GTX1080

Blender Version
Broken: 2.79b

Short description of error
Importing an FBX file exported by the Witcher Mod Tools (wcc_lite.exe), refuses to import vertex weights, and imports all bones as empties. This happens consistently with all the FBX files this tool generates.

Exact steps for others to reproduce the error
Import the attached FBX file through the File -> Import -> FBX dialog. No vertex groups are imported, and all bones are imported as empty/null objects, instead of a complete armature. See attached file.
item_09.fbx

Further info
I attempted to make this work for me by making some edits to the importer plugin, and came to this bit of code in import_fbx.py.

            - Note: 'Root' "bones" are handled as (armature) objects.
            - Note: See blender/blender-addons#46912 for first FBX file I ever saw with 'Limb' bones - thought those were totally deprecated.
```
          is_bone = fbx_obj.props[2] in {b'LimbNode', b'Limb'}
          fbx_helper_nodes[a_uuid] = FbxImportHelperNode(fbx_obj, bl_data, transform_data, is_bone)````
```
I looked at the FBX file, using the FBX explorer that Autodesk provides, and saw that all the bones in the FBX file are stored as "Root". This bit of code suggests that those bones are handled as individual Armature objects, and I expect that's where the issue stems from. Adding b'Root' to the set with the Limb/Limbnode in this bit of code, solves the problem for me, but I am unsure whether or not this is the correct approach, and whether or not this breaks compatibility with other FBX files.
**System Information** Win10, Nvidia GTX1080 **Blender Version** Broken: 2.79b **Short description of error** Importing an FBX file exported by the Witcher Mod Tools (wcc_lite.exe), refuses to import vertex weights, and imports all bones as empties. This happens consistently with all the FBX files this tool generates. **Exact steps for others to reproduce the error** Import the attached FBX file through the `File -> Import -> FBX` dialog. No vertex groups are imported, and all bones are imported as empty/null objects, instead of a complete armature. See attached file. [item_09.fbx](https://archive.blender.org/developer/F3821856/item_09.fbx) **Further info** I attempted to make this work for me by making some edits to the importer plugin, and came to this bit of code in `import_fbx.py`. ```` transform_data = blen_read_object_transform_preprocess(fbx_props, fbx_obj, Matrix(), use_prepost_rot) - Note: 'Root' "bones" are handled as (armature) objects. - Note: See blender/blender-addons#46912 for first FBX file I ever saw with 'Limb' bones - thought those were totally deprecated. ``` is_bone = fbx_obj.props[2] in {b'LimbNode', b'Limb'} fbx_helper_nodes[a_uuid] = FbxImportHelperNode(fbx_obj, bl_data, transform_data, is_bone)```` ``` I looked at the FBX file, using the FBX explorer that Autodesk provides, and saw that all the bones in the FBX file are stored as "Root". This bit of code suggests that those bones are handled as individual Armature objects, and I expect that's where the issue stems from. Adding b'Root' to the set with the Limb/Limbnode in this bit of code, solves the problem for me, but I am unsure whether or not this is the correct approach, and whether or not this breaks compatibility with other FBX files.
Author

Added subscriber: @HiddeJansen

Added subscriber: @HiddeJansen

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2018-07-23 20:45:04 +02:00

Am sorry, but am way over-tired of all application doing pretty much their own version of FBX… that’s what you get when you do not publish some specs. In the mean time, Blender does not have the resources to add compat specific handling of all and any flavor of FBX, so am afraid we just won’t support those Witcher files for now… Should be possible to work around that mess by importing/re-exporting with an itermediary, more FBX-compliant tool I guess? Thanks for the report anyway.

Am sorry, but am way over-tired of all application doing pretty much their own version of FBX… that’s what you get when you do not publish some specs. In the mean time, Blender does not have the resources to add compat specific handling of all and any flavor of FBX, so am afraid we just won’t support those Witcher files for now… Should be possible to work around that mess by importing/re-exporting with an itermediary, more FBX-compliant tool I guess? Thanks for the report anyway.
Author

Hi, thanks for taking the time to reply. I'm sure you guys are really busy finalizing 2.8 and I understand your frustration with FBX. I sympathize, but as I mentioned in my initial post, I managed to "fix" it for my personal use. Assuming you read the actual ticket, you would notice that with the change I described, the mesh loads without issue. It actually loads better than both Maya and 3ds Max. Maya loads the UV but not the bones (same as Blender did), 3ds Max does the opposite. My initial workflow was to use 3ds Max to export the bone structure, and then combine it with Blender's import using Blender's data transfer feature.. But having to do this for 50+ objects is tiring, even with some scripting. That's why I went searching for a solution in the FBX addon. To my surprise, it worked.

What I would like to know, is why this simple edit worked, what this specific handling of the "Limb" bone actually does and how common it actually is. It seems like it was only put in there to add compatibility with the Wow Model Viewer. And while WMV uses the FBX SDK, how common is this specific Limb type? I understand that you will not support obscure tools, but where do you folks draw the line? Do you have a test set of FBX files that you test the importer with?

I'm not asking you to support this specific implementation of the format. I'm just trying to understand how the format works, and how the importer works. I'm trying to improve as a developer and getting involved in the process, but frankly your reply came across as dismissive and uninterested.

Hi, thanks for taking the time to reply. I'm sure you guys are really busy finalizing 2.8 and I understand your frustration with FBX. I sympathize, but as I mentioned in my initial post, I managed to "fix" it for my personal use. Assuming you read the actual ticket, you would notice that with the change I described, the mesh loads without issue. It actually loads better than both Maya and 3ds Max. Maya loads the UV but not the bones (same as Blender did), 3ds Max does the opposite. My initial workflow was to use 3ds Max to export the bone structure, and then combine it with Blender's import using Blender's data transfer feature.. But having to do this for 50+ objects is tiring, even with some scripting. That's why I went searching for a solution in the FBX addon. To my surprise, it worked. What I would like to know, is *why* this simple edit worked, what this specific handling of the "Limb" bone actually does and how common it actually is. It seems like it was only put in there to add compatibility with the Wow Model Viewer. And while WMV uses the FBX SDK, how common is this specific Limb type? I understand that you will not support obscure tools, but where do you folks draw the line? Do you have a test set of FBX files that you test the importer with? I'm not asking you to support this specific implementation of the format. I'm just trying to understand how the format works, and how the importer works. I'm trying to improve as a developer and getting involved in the process, but frankly your reply came across as dismissive and uninterested.

Added subscriber: @CraigD

Added subscriber: @CraigD

Sorry to resurrect an old thread. But thank you for posting your solution Hidde Jansen. You just saved me!

I understand your position Bastien. It seems like a pretty easy fix got handed to you on a platter, but obviously I don't know if there would be adverse effects in other use cases and you'd obviously have to spend time ensuring it wouldn't break things. But it would have been really nice not to have spent the last couple hours pulling my hair out.

Sorry to resurrect an old thread. But thank you for posting your solution Hidde Jansen. You just saved me! I understand your position Bastien. It seems like a pretty easy fix got handed to you on a platter, but obviously I don't know if there would be adverse effects in other use cases and you'd obviously have to spend time ensuring it wouldn't break things. But it would have been really nice not to have spent the last couple hours pulling my hair out.
Member

Added subscriber: @Mets

Added subscriber: @Mets
Member

Changed status from 'Archived' to: 'Confirmed'

Changed status from 'Archived' to: 'Confirmed'
Member

I ran into this again today after many years, but now I have commit rights, and Bastien can see my puppy eyes IRL, so let's try this again!

I ran into this again today after many years, but now I have commit rights, and Bastien can see my puppy eyes IRL, so let's try this again!
Member

Talked with Bastien, we'd like to make sure this at least doesn't break FBX import support for FBX output by Maya/Max/Unity/UE4, so if anyone could help out with such .fbx files, that would be much appreciated!

Talked with Bastien, we'd like to make sure this at least doesn't break FBX import support for FBX output by Maya/Max/Unity/UE4, so if anyone could help out with such .fbx files, that would be much appreciated!
Member

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Member

RIP, the change actually affects fbx files exported from Unity, and I'm not up to the task to figure out why, so nevermind, sorry guys :P

RIP, the change actually affects fbx files exported from Unity, and I'm not up to the task to figure out why, so nevermind, sorry guys :P
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
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#55670
No description provided.