Drivers: duplication won't preserve targeted objects #39079

Closed
opened 2014-03-10 04:50:42 +01:00 by Mikhail Rachinskiy · 12 comments

System Information
Windows 8.1 x64
Renderer: GeForce GTX 650/PCIe/SSE2
Vendor: NVIDIA Corporation
Version: 4.4.0

Blender Version
Broken: 2.69.8 36279af

Short description of error
Targeted objects are not preserved when duplicate with single driver.

Exact steps for others to reproduce the error

  • Open blend file driver.blend
  • Select 1st object (3 drivers rotation) and duplicate it = driver targets are preserved
  • Select 2nd object (1 driver location) and duplicate it = driver targets are not preserved
  • Select last object and duplicate it = driver targets are not preserved

Here is the image of which targets I am talking about drivers.png

**System Information** Windows 8.1 x64 Renderer: GeForce GTX 650/PCIe/SSE2 Vendor: NVIDIA Corporation Version: 4.4.0 **Blender Version** Broken: 2.69.8 36279af **Short description of error** Targeted objects are not preserved when duplicate with single driver. **Exact steps for others to reproduce the error** - Open blend file [driver.blend](https://archive.blender.org/developer/F80500/driver.blend) - Select 1st object (3 drivers rotation) and duplicate it = driver targets are preserved - Select 2nd object (1 driver location) and duplicate it = driver targets are not preserved - Select last object and duplicate it = driver targets are not preserved Here is the image of which targets I am talking about ![drivers.png](https://archive.blender.org/developer/F80501/drivers.png)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @MikhailRachinskiy

Added subscriber: @MikhailRachinskiy
Member

Added subscriber: @LukasTonne

Added subscriber: @LukasTonne
Member

What happens here is an automatic re-targetting of ID block references on duplicating:

Any pointer inside duplicated objects, which points to one of the duplicated objects, is set to the respective new object copy.

For a single object this means that only references from this object to itself are re-targetted.

  • The first object's drivers use the object itself -> gets re-targeted
  • The second object's driver uses a different object which is not duplicated along with it -> no re-targeting
  • The third object's driver uses a different object -> no re-targeting. The Shape Keys are actually a separate datablock which IIRC is not duplicated along with the object, so even if it referenced the same object that link may get lost / end up wrong.

It's not ideal, but can't think of an unambiguous way to do it better ...

What happens here is an automatic re-targetting of ID block references on duplicating: *Any pointer inside duplicated objects, which points to one of the duplicated objects, is set to the respective new object copy.* For a single object this means that only references *from* this object to *itself* are re-targetted. * The first object's drivers use the object itself -> gets re-targeted * The second object's driver uses *a different object* which is not duplicated along with it -> no re-targeting * The third object's driver uses a different object -> no re-targeting. The Shape Keys are actually a separate datablock which IIRC is not duplicated along with the object, so even if it referenced the same object that link may get lost / end up wrong. It's not ideal, but can't think of an unambiguous way to do it better ...
Author
Member

Sorry I messed up with the example, yes the issue is appearing only with shapekeys.

Well this is a very serious flaw, with current system it is not possible to make simple animations with many objects in relation to the distance between empty and the object itself, like this: mg4-3.gif

Sorry I messed up with the example, yes the issue is appearing only with shapekeys. Well this is a very serious flaw, with current system it is not possible to make simple animations with many objects in relation to the distance between empty and the object itself, like this: ![mg4-3.gif](https://archive.blender.org/developer/F80517/mg4-3.gif)

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @Sergey

Added subscriber: @Sergey

@LukasTonne, is it something solvable with current design or it's a limitation of it a rather a TODO?

@LukasTonne, is it something solvable with current design or it's a limitation of it a rather a TODO?
Member

I think this is not strictly speaking a bug. We could consider extending the duplication such that:

Any Object pointer referenced by a duplicated Object or a nested data block (i.e. shape keys) is redirected

However, this leads us into ambiguous territory. By their nature, data blocks such as shape keys can be shared among many different objects. Redirecting driver targets when any of these is duplicated might work in one case but have undesired results in others. It might be difficult to prevent circular references and such.

I would prefer to leave the system as it is now, only modify Object pointers directly inside Object data blocks.

@MikhailRachinskiy: For the use case you describe, where a great number of objects need to be set up with correct drivers, it's preferable to write a specialized tool (i.e. a python script). The generic duplicate operator simply is not capable of guessing the desired outcome correctly.

I think this is not strictly speaking a bug. We could consider extending the duplication such that: *Any Object pointer referenced by a duplicated Object **or a nested data block** (i.e. shape keys) is redirected* However, this leads us into ambiguous territory. By their nature, data blocks such as shape keys can be shared among many different objects. Redirecting driver targets when *any* of these is duplicated might work in one case but have undesired results in others. It might be difficult to prevent circular references and such. I would prefer to leave the system as it is now, only modify Object pointers directly inside Object data blocks. @MikhailRachinskiy: For the use case you describe, where a great number of objects need to be set up with correct drivers, it's preferable to write a specialized tool (i.e. a python script). The generic duplicate operator simply is not capable of guessing the desired outcome correctly.
Author
Member

@LukasTonne or implement a new object target selectors such as:
This object - pointing at current object, similar to jQuery $(this)
Parent object - pointing at parent object from current object, similar to jQuery $(this).parent()

Untitled.png

Of course This object selector would not be possible for all modifiers or constraints, and it is no way to be implemented in the near future (or implemented at all). Just my thoughts on how selector system could be augmented, if you have intentions about it.

@LukasTonne or implement a new object target selectors such as: **This object** - pointing at current object, similar to jQuery **$(this)** **Parent object** - pointing at parent object from current object, similar to jQuery **$(this).parent()** ![Untitled.png](https://archive.blender.org/developer/F86798/Untitled.png) Of course **This object** selector would not be possible for all modifiers or constraints, and it is no way to be implemented in the near future (or implemented at all). Just my thoughts on how selector system could be augmented, if you have intentions about it.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sergey Sharybin self-assigned this 2014-05-19 17:27:33 +02:00

Agree with Lukas. Moving to TODO http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Animation_System

Thanks for the report, but closing it now.

Agree with Lukas. Moving to TODO http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Animation_System Thanks for the report, but closing it now.
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#39079
No description provided.