Library Override: Parent-child relation not working for some objects #84313

Closed
opened 2021-01-01 18:22:23 +01:00 by Bernhard Engstler · 19 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
Worked: no info yet

Short description of error
Parent-child relation is not working for two objects in a particular scene with library overrides. The relation info in the object properties show the correct empty as parent, but the objects don't move with the parent. However, the parenting works correctly in the source file.

Exact steps for others to reproduce the error
I recorded a video of what I'm doing:
https://youtu.be/B-D80YNR_r0

"MOD_Locust_Cockpit_v007_bE.blend" is the source file acting as a library. Everything works as expected.
"LibraryOverride.blend" is the blend file where I linked the collection and made a library overrided. The two objects "Locust_Cockpit_Console_New" and "Slice.010" don't move with the parent "LCT_Cockpit_Root". Only after clearing the parent and parenting again it works. This also did not work with the original file. The attached files are heavily reduced in complexity so I could share them. Also, when I make the library override again with the reduced files it is working out of the box, so some problem must have been carried over from the original files. I hope this helps to identify a possible problem.

LibraryOverrideProblem.zip

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89 **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` Worked: no info yet **Short description of error** Parent-child relation is not working for two objects in a particular scene with library overrides. The relation info in the object properties show the correct empty as parent, but the objects don't move with the parent. However, the parenting works correctly in the source file. **Exact steps for others to reproduce the error** I recorded a video of what I'm doing: https://youtu.be/B-D80YNR_r0 "MOD_Locust_Cockpit_v007_bE.blend" is the source file acting as a library. Everything works as expected. "LibraryOverride.blend" is the blend file where I linked the collection and made a library overrided. The two objects "Locust_Cockpit_Console_New" and "Slice.010" don't move with the parent "LCT_Cockpit_Root". Only after clearing the parent and parenting again it works. This also did not work with the original file. The attached files are heavily reduced in complexity so I could share them. Also, when I make the library override again with the reduced files it is working out of the box, so some problem must have been carried over from the original files. I hope this helps to identify a possible problem. [LibraryOverrideProblem.zip](https://archive.blender.org/developer/F9548640/LibraryOverrideProblem.zip)

Added subscriber: @B_Engstler

Added subscriber: @B_Engstler

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

The nvoglv64.dll is part of Nvidias driver, but this might be a red herring. Could you please try to simplify your project(s) as much as possible so that it only contains the bare minimum to reproduce the problem and attach the file(s) to your report?

The `nvoglv64.dll` is part of Nvidias driver, but this might be a red herring. Could you please try to simplify your project(s) as much as possible so that it only contains the bare minimum to reproduce the problem and attach the file(s) to your report?
Bernhard Engstler changed title from Crash with EXCEPTION_ACCESS_VIOLATION after parenting objects with library override to Library Override: Parent-child relation not working for some objects 2021-01-03 09:48:52 +01:00

I changed the task description, as I could not reproduce the crash caused by the nvoglv64.dll, and this is perhaps unrelated to the other issue with library overrides. If I find out more to the nvidia bug I'll post it seperately. The attached blend files are already greatly reduced in complexity.

I changed the task description, as I could not reproduce the crash caused by the nvoglv64.dll, and this is perhaps unrelated to the other issue with library overrides. If I find out more to the nvidia bug I'll post it seperately. The attached blend files are already greatly reduced in complexity.

Trying to find out more I noticed that the trouble starts when I use the shift+s pie menu to snap the root of the overridden objects to the 3D cursor. For some reason the "Offset" was on in the "adjust last operation" menu, but I never noticed as the menu was always collapsed. I have no idea how I can fix it afterwards or how I can access that "offset" property to turn it off per object, other than clearing the parent and parenting again? If this is not a bug it is at least a usability problem. An info in the "Relations" section of the object properties would be the minimum I'd expect, unless I too ignorant and don't know where to look at :)

Edit: I'm sorry if this starts to feel like spamming already, but not using the offset option only apparently solved the problem after snapping, but continued after moving the root again manually. I'll have to avoid library overrides altogether for now, as I've spent way too much time to try to make it work :(

Trying to find out more I noticed that the trouble starts when I use the shift+s pie menu to snap the root of the overridden objects to the 3D cursor. For some reason the "Offset" was on in the "adjust last operation" menu, but I never noticed as the menu was always collapsed. I have no idea how I can fix it afterwards or how I can access that "offset" property to turn it off per object, other than clearing the parent and parenting again? If this is not a bug it is at least a usability problem. An info in the "Relations" section of the object properties would be the minimum I'd expect, unless I too ignorant and don't know where to look at :) Edit: I'm sorry if this starts to feel like spamming already, but not using the offset option only apparently solved the problem after snapping, but continued after moving the root again manually. I'll have to avoid library overrides altogether for now, as I've spent way too much time to try to make it work :(

Added subscriber: @unwave

Added subscriber: @unwave

Some override making methods retain a linked object as a parent. It is not a parent-child relationship not working but a parent-child relationship with a wrong parent.

for object in bpy.data.objects:

parent = object.parent
if parent and parent.library:
object.parent = bpy.data.objects.get(parent.name)

Some override making methods retain a linked object as a parent. It is not a parent-child relationship not working but a parent-child relationship with a wrong parent. ```lang=python, name = This code should fix the problem: for object in bpy.data.objects: ``` parent = object.parent if parent and parent.library: object.parent = bpy.data.objects.get(parent.name) ```

Thanks a lot for that code! It really solved the problem. I'm very interested under which circumstances the parent-child relationship is maintained to a linked parent after overriding. I'm not aware that I have done anything differently to these two objects than to the others. And the UI lacks any kind of information if the parent is in the same file or in the linked file. Perhaps some more documentation on the "under the hood" of linking and overriding would help a great deal.

Anyway, your are my hero of the day :)

Thanks a lot for that code! It really solved the problem. I'm very interested under which circumstances the parent-child relationship is maintained to a linked parent after overriding. I'm not aware that I have done anything differently to these two objects than to the others. And the UI lacks any kind of information if the parent is in the same file or in the linked file. Perhaps some more documentation on the "under the hood" of linking and overriding would help a great deal. Anyway, your are my hero of the day :)

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Also, when I make the library override again with the reduced files it is working out of the box

I also cannot redo this from scratch, also tried the snapping (with or without the Offset option)

@unwave : you were mentioning that

Some override making methods retain a linked object as a parent

Could you shed some light on this? This could really help finding reproducable steps here [without repro steps from provided files, this is going to be hard to solve I am afraid]

I am setting this to Needs Information from User, but also getting @mont29 in the loop early (since it might ring a bell for him?)

> Also, when I make the library override again with the reduced files it is working out of the box I also cannot redo this from scratch, also tried the snapping (with or without the Offset option) @unwave : you were mentioning that > Some override making methods retain a linked object as a parent Could you shed some light on this? This could really help finding reproducable steps here [without repro steps from provided files, this is going to be hard to solve I am afraid] I am setting this to `Needs Information from User`, but also getting @mont29 in the loop early (since it might ring a bell for him?)
Member

Trying to think of ways to proceed here.

I think we really need a reproducable case of

Some override making methods retain a linked object as a parent

Can anybody provide this?

Trying to think of ways to proceed here. I think we really need a reproducable case of > Some override making methods retain a linked object as a parent Can anybody provide this?

Added subscriber: @Threedio

Added subscriber: @Threedio

{F9880328If I'm understanding the original error (part of a class of issues related to parenting & overrides) }I have a simple reproducible case, attached in a ZIP. Here are the steps I took to create it:

Made a file called mickey.character.blend which will be our mouse head

  • delete everything except for default cube
  • rename the cube to "Mickey"
  • rename the collection to "Collection.Mickey"
  • save
  • close

create a new file called bugtest.parent.blend which will be our scene that contains our mouse head

  • delete everything
  • link in Collection.Mickey from mickey.character.blend
  • make it a library override
  • save
  • close

open mickey.character.blend

  • add two spheres for ears
  • parent the spheres to the cube. Now when you move the cube (the head) the ears (spheres) will move with it
  • save
  • close

open bugtest.parent.blend

  • you will see the spheres added to the character
  • if you look at the Relations of the spheres, it will show that they are parented to Mickey
  • but if you move the cube, the ears won't move with it (the parenting is not working)

Now here is where it gets interesting. This script will NOT fix the issue:

for obj in bpy.data.objects:
    if obj.parent is not None:
        obj.parent = obj.parent

But this script WILL fix the issue:

for obj in bpy.data.objects:
    if obj.parent is not None:
        newparent = bpy.data.objects[obj.parent.name]
        obj.parent = newparent

Also interestingly, if you run the second script to fix the issue, then undo everything in the undo history, the issue is STILL fixed even though you undid the action of the script.

{F9880328If I'm understanding the original error (part of a class of issues related to parenting & overrides) }I have a simple reproducible case, attached in a ZIP. Here are the steps I took to create it: Made a file called mickey.character.blend which will be our mouse head - delete everything except for default cube - rename the cube to "Mickey" - rename the collection to "Collection.Mickey" - save - close create a new file called bugtest.parent.blend which will be our scene that contains our mouse head - delete everything - link in Collection.Mickey from mickey.character.blend - make it a library override - save - close - open mickey.character.blend - add two spheres for ears - parent the spheres to the cube. Now when you move the cube (the head) the ears (spheres) will move with it - save - close - open bugtest.parent.blend - you will see the spheres added to the character - if you look at the Relations of the spheres, it will show that they are parented to Mickey - but if you move the cube, the ears won't move with it (the parenting is not working) ``` ``` Now here is where it gets interesting. This script will NOT fix the issue: ``` for obj in bpy.data.objects: if obj.parent is not None: obj.parent = obj.parent ``` But this script WILL fix the issue: ``` for obj in bpy.data.objects: if obj.parent is not None: newparent = bpy.data.objects[obj.parent.name] obj.parent = newparent ``` Also interestingly, if you run the second script to fix the issue, then undo everything in the undo history, the issue is STILL fixed even though you undid the action of the script.

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'

Nothing special here, your linked spheres in bugtest.parent.blend are parented to the linked head, not the local override.

Now you also need to create overrides for those sphere objects, and then remap their parent pointers to the override head. You could do this by hand, but the Resync operation is here to take care of that automatically (right-click menu in the Outliner, on your override collection).

Note that in 2.93 this should be handled fully automatically, during .blend file loading those cases will be detected, and the resync process will be run where needed (see #83811).

Nothing special here, your linked spheres in `bugtest.parent.blend` are parented to the linked head, not the local override. Now you also need to create overrides for those sphere objects, and then remap their parent pointers to the override head. You could do this by hand, but the `Resync` operation is here to take care of that automatically (right-click menu in the Outliner, on your override collection). Note that in 2.93 this should be handled fully automatically, during .blend file loading those cases will be detected, and the resync process will be run where needed (see #83811).

Oh gosh I wish I had seen that resync feature, that would have saved me a lot of trouble :) Yes it totally works of course. Thank you Bastien.

Oh gosh I wish I had seen that resync feature, that would have saved me a lot of trouble :) Yes it totally works of course. Thank you Bastien.
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
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#84313
No description provided.