Page MenuHome

odd behavior when appending an armature with custom shapes
Closed, ArchivedPublic


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:

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: 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-> == 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.



Event Timeline

Bastien Montagne (mont29) closed this task as Archived.
Bastien Montagne (mont29) claimed this task.

Similar issue as in T67032, 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...

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.

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:

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

  1. 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.
  1. 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.