Incorrect parent tree when exporting and importing scene with multiple rigged objects #56677
Labels
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#56677
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Arch GNU+Linux, Kernel 4.18.5
Blender Version
Broken: 2.79.6, Git
19c65cd
(branch master)Worked: None that I'm aware of
Short description of error
If you have a scene with multiple rigged objects, the armatures and meshes are incorrectly parented upon exporting then importing them. Rather than there being two armatures at the root of the scene with each one containing a single mesh, there will be (if you have two objects) one armature at the root, the other armature as a child of it, with both meshes attached to the inner-most armature.
Note that this certainly seems to be a fault of the importer and not the exporter: I've manually reviewed the exported model and it appears fine. Additionally, upon attempting to import a Collada file generated by custom software I've got the exact same problem as importing the file generated by Blender.
Exact steps for others to reproduce the error
Start with an empty scene, and create a cube. Add a single bone. Make the cube a child of the bone, using the armature deform with automatic weights option (not using any weights prevents this problem from occurring).
Repeat this a second time.
Export the scene as a Collada file.
Open a new instance of Blender, and import the scene with Collada.
The objects will have incorrect parents, and this has consistently occurred each time I have tried it:
Here are the screenshots of the scene, before exporting (matches attached blend file):
And after export/import:
Sample Blender file before export: expimptest.blend
Added subscriber: @ZNix
Added subscriber: @GaiaClary
Added subscriber: @Blendify
I can confirm
Added subscriber: @cgbloor
I noticed there's a comment in the ArmatureImporter that says:
A bit of printf debugging reveals that unsafe path is taken when importing a COLLADA file exported from Campbell's expimptest.blend. Perhaps that's related. I don't understand the code, but commenting out that if block results in each armature being given its own child armature (so, 4 armatures when importing 2), but the armatures in the COLLADA file do become seperate, top-level armatures.
So, I think more or less understand the problem, though solving it is another matter. In the COLLADA file itself, the root joint node points to the instance controller, which has a skin that points to the geometry. The OpenCOLLADA Sax parser, however, has a different structure, and it's not super clear how you go from a COLLADAFWSkinController, COLLADAFWSkinControllerData or COLLADAFWMesh to the COLLADAFWNode (or vice versa).
Blender creates its armatures when it encounters the armature nodes and needs to add data to them when it encounters the skin controllers, but it's not really clear which node the skin controller is for. So, the author of the importer just picked the first one and put a TODO to fix it for files containing multiple armatures.
I would say this is more of a missing feature than a bug. I actually tried to solve this issue a while back (some years ago) but at that time i was not able to fix that. I guess the original developer skipped that for a reason ... And i am also not sure if this is a nice to have feature or a must fix issue.
Opinions are welcome :)
For me, it's just nice-to-have. I can concaternate all my objects together, or script importing a series of files, and it will be almost as good.
One thing that would have helped me is a warning in the log or console when trying to import a file with multiple armatures. I spent a while thinking I had screwed something up in writing my COLLADA file. A message from the importer would have saved a bunch of debugging.
This is a valid complaint :)
I add a warning.