odd behavior when appending an armature with custom shapes #68794

Closed
opened 2019-08-18 13:52:43 +02:00 by Gaia Clary · 8 comments
Member

System Information
Operating system: windows
Graphics card: nvidia

Blender Version
Broken: not sure if it wever worked before
Worked: (optional)

Short description of error

In the original blend file the custom shapes for an armature have been defined outside of any scene. So they do not show up as regular objects, they are not members of any collection and they are not members of the current scene. Only when i enable custom shapes on the armature they show up as custom bones as intended. this is the blendfile:

armature.blend

When i open a fresh blender scene and then append the armature from the above blend file, i expect the custom shapes to be treated in the same way as in the original model: They should be invisible, not defined as objects within the scene and not added to any collection.

But this is not the case.

Exact steps for others to reproduce the error

  • open a fresh empty blender scene.
  • File -> Append -> the_blend_file -> Object -> Avatar

Now the armature is appended and all custom shapes are parented to the armature.

A workaround for this issue:

  • open a fresh empty blender scene.
  • File -> Link -> the_blend_file -> Object -> Avatar
  • Object -> relations -> make local -> All

Now the armature is defined as expected. The custom shape objects are hidden, they are not defined as members of the scene and they are not added to any collection as expected.

Where i looked so far

i found this task: https://developer.blender.org/T27437 which is actually about the same issue. However i tend to believe: if the custom shapes where not editable in the original file, why should they be editable in the appended file ?

This helps to fix the problem although i am almost sure this is not the correct way to do it:

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 737a70615ae..91ff40ff386 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11118,7 +11118,7 @@ static void add_loose_objects_to_scene(Main *mainvar,
         if (ob->id.us == 0) {
           do_it = true;
         }
-        else if ((ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 0)) {
+        else if ((ob->id.lib == lib) && (object_in_any_scene(bmain, ob) > 0)) {
           /* When appending, make sure any indirectly loaded objects get a base,
            * else they cant be accessed at all
            * (see T27437). */

Maybe there can be an option in the "append from library" panel to "include linked objects which are not used in scene" This would at least allow users to decide if they want the objects or not.

**System Information** Operating system: windows Graphics card: nvidia **Blender Version** Broken: not sure if it wever worked before Worked: (optional) **Short description of error** In the original blend file the custom shapes for an armature have been defined outside of any scene. So they do not show up as regular objects, they are not members of any collection and they are not members of the current scene. Only when i enable custom shapes on the armature they show up as custom bones as intended. this is the blendfile: [armature.blend](https://archive.blender.org/developer/F7670597/armature.blend) When i open a fresh blender scene and then append the armature from the above blend file, i expect the custom shapes to be treated in the same way as in the original model: They should be invisible, not defined as objects within the scene and not added to any collection. But this is not the case. **Exact steps for others to reproduce the error** * open a fresh empty blender scene. * File -> Append -> the_blend_file -> Object -> Avatar Now the armature is appended and all custom shapes are parented to the armature. **A workaround for this issue:** * open a fresh empty blender scene. * File -> Link -> the_blend_file -> Object -> Avatar * Object -> relations -> make local -> All Now the armature is defined as expected. The custom shape objects are hidden, they are not defined as members of the scene and they are not added to any collection as expected. **Where i looked so far** i found this task: https://developer.blender.org/T27437 which is actually about the same issue. However i tend to believe: if the custom shapes where not editable in the original file, why should they be editable in the appended file ? This helps to fix the problem although i am almost sure this is not the correct way to do it: ``` diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 737a70615ae..91ff40ff386 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -11118,7 +11118,7 @@ static void add_loose_objects_to_scene(Main *mainvar, if (ob->id.us == 0) { do_it = true; } - else if ((ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 0)) { + else if ((ob->id.lib == lib) && (object_in_any_scene(bmain, ob) > 0)) { /* When appending, make sure any indirectly loaded objects get a base, * else they cant be accessed at all * (see T27437). */ ``` Maybe there can be an option in the "append from library" panel to "include linked objects which are not used in scene" This would at least allow users to decide if they want the objects or not.
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2019-08-19 17:21:36 +02:00

Similar issue as in #67032, but here you are appending the object itself, so you need to put all those indirectly linked shapes somewhere (we now allow objects not to be instantiated in any scene, but they must belong to at least one collection).

So no bug here, this should be handled by defining and then linking/appending a proper collection instead...

Similar issue as in #67032, but here you are appending the object itself, so you need to put all those indirectly linked shapes somewhere (we now allow objects not to be instantiated in any scene, but they *must* belong to at least one collection). So no bug here, this should be handled by defining and then linking/appending a proper collection instead...
Author
Member

in the attached blendfile armature.blend the custom shapes are not contained in any collection. The armature was generated in blender 2.80 with python (addon) and the custom shapes have been left outside the scene on purpose. From your comment i understand that this blendfile is corrupt or at least wrong defined for Blender 2.80 ?

in the attached blendfile armature.blend the custom shapes are not contained in any collection. The armature was generated in blender 2.80 with python (addon) and the custom shapes have been left outside the scene on purpose. From your comment i understand that this blendfile is corrupt or at least wrong defined for Blender 2.80 ?

Yes, add-ons should not generate objects without adding them to at least one collection. This is not a good practice.

Yes, add-ons should not generate objects without adding them to at least one collection. This is not a good practice.
Author
Member

i reopen this report because i am deeply not convinced that Blender behaves correct here. Here is why:

  • I have created a new blendfile that contains a collection with the custom bone shapes as requested
  • the collection is not part of the scene but it can be seen in the Blender File section of the Outliner.

So here we have an armature that uses custom shapes from a collection that is part of the blendfile but not part of the scene. And according to the above explanations there is nothing wrong with this blendfile.

The blendfile is here: avastar_rigs.blend

Now i again open a fresh blend file and then i try two things:

I try to append the collection. I expect that:

  • Either the collection is appended as it was defined in the original blend file (i.e. not as part of the scene)
  • Optionally i can specify if i want the collection to be appended "as is" or append as part of the scene
But the collection is always appended into the current scene.

I try to append the armature. I expect that:

  • the armature is appended to the current active Collection
  • The customshape collection is added t the current blend file but not to the scene
  • the armature uses the custom bone shapes from the custom shape collection

But the custom shapes are added as regular children to the Armature.

So is Blender just not capable to append armatures with custom shapes in a way that the custom shapes keep isolated in a collection outside of the scene? Or is this after all a bug? Or is the append feature simply not used as i try to use it? In that case what is the recommended way to keep the appended custom shapes in the customshape collection?

i reopen this report because i am deeply not convinced that Blender behaves correct here. Here is why: - I have created a new blendfile that contains a collection with the custom bone shapes as requested - the collection is not part of the scene but it can be seen in the Blender File section of the Outliner. So here we have an armature that uses custom shapes from a collection that is part of the blendfile but not part of the scene. And according to the above explanations there is nothing wrong with this blendfile. The blendfile is here: [avastar_rigs.blend](https://archive.blender.org/developer/F7703073/avastar_rigs.blend) Now i again open a fresh blend file and then i try two things: # I try to append the collection. I expect that: - Either the collection is appended as it was defined in the original blend file (i.e. not as part of the scene) - Optionally i can specify if i want the collection to be appended "as is" or append as part of the scene ``` But the collection is always appended into the current scene. ``` # I try to append the armature. I expect that: - the armature is appended to the current active Collection - The customshape collection is added t the current blend file but not to the scene - the armature uses the custom bone shapes from the custom shape collection But the custom shapes are added as regular children to the Armature. So is Blender just not capable to append armatures with custom shapes in a way that the custom shapes keep isolated in a collection outside of the scene? Or is this after all a bug? Or is the append feature simply not used as i try to use it? In that case what is the recommended way to keep the appended custom shapes in the customshape collection?

Blender won't append the collection of the custom shapes unles that collection is linked by something that is appended (armature only links in objects, not their collection).

Typical workflow here is to put everything you need under a 'parent', 'main' collection (armature, collection of its bone shapes [probably hidden], etc.), and link or append that main collection.

Blender won't append the collection of the custom shapes unles that collection is linked by something that is appended (armature only links in objects, not their collection). Typical workflow here is to put everything you need under a 'parent', 'main' collection (armature, collection of its bone shapes [probably hidden], etc.), and link or append that main collection.
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
2 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#68794
No description provided.