Page MenuHome

Driver read but not write values to linked objects
Closed, ArchivedPublic

Description

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.15

Blender Version
Broken: version: 2.81 (sub 11), branch: master, commit date: 2019-09-16 21:02, hash: rB76650402f300
Worked: (optional)

Short description of error
Setting a value to linked objects works with

bpy.data.objects['myCube'].pass_index = 2

or

bpy.data.objects['myCube'].pass_index = bpy.data.objects['Controller']['my_new_index']

but not when accessed via driver

Exact steps for others to reproduce the error
Ok, I dont know if this is a limitation , a bug, a missunderstandment from me or a wrong setup as seen in the Image
but
my driver reads the correct value from the linked object "myCube" and I can set the value via Python

I created myCube in a second file
--> my cube has different colors based on object Index
I create a mainfile and link myCube in
--> to test the linked Connection I change myCube.pass_index via Python
--> colors of myCube changes accordingly
I create a Driver with single property set to myCube.pass_index
value is shown as set in myCube file
I create second var that catches the value of a custom property called my_new_index from "Controller" object
I change "my_new_index" and the Driver value changes accordingly but
--> Colors dont change - so pass index is not changed
--> to test the linked Connection I change myCube.pass_index via Python
--> colors of myCube changes accordingly

it seems that values of linked objects can be Change with Python and can be read by a Driver but not written

[Based on the default startup or an attached .blend file (as simple as possible)]
here are the files - myCube has to be in assets Folder reletiv to Main.blend


Event Timeline

Additional:


The Driver connection is lost after closing and reopening the Scene (Main.blend)

Philipp Oeser (lichtwerk) closed this task as Archived.Dec 29 2019, 2:58 PM
Philipp Oeser (lichtwerk) claimed this task.

From those files, I cannot tell how this is supposed to work:

I change "my_new_index" and the Driver value changes accordingly but
--> Colors dont change - so pass index is not changed

  • this driver is on a custom property of the collection instance (how is this supposed to drive the pass index of the linked object?)

It is true you can change properties on linked IDs via python (but not permanently, these are lost on file save/reload), but to my knowledge you cannot drive them.
For this to work properly, you need to use the old Proxy System (or the new Library Overrides)
Also you should not read from the same value, add to it and write to it, this will result in dependency cycles.
(it is better to already rig the pass_index in the myCube.blend file with something that can be used as a proxy from the Main.blend, so they dont end up in a dependency cycle)

https://docs.blender.org/manual/en/dev/files/linked_libraries/library_proxies.html
https://docs.blender.org/manual/en/dev/files/linked_libraries/library_overrides.html

If I have not misunderstood something, this sounds like no bug, I think we'll have to close this report (feel free though to comment again if you think I have misunderstood your report -- or if issues persist using the other mentioned methods)