Page MenuHome

Node info python path always uses bpy.data.node_groups collection
Closed, InvalidPublicTO DO

Description

--- Operating System, Graphics card ---

Testet on Win7 64bit

--- Blender version with error, and version that worked ---

All recent builds produce that error

--- Short description of error ---

Error massage in console: (See attachement)

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
KeyError: 'bpy_prop_collection[key]: key "Compositing Nodetree" not found'

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Change any node value of any node (of any nodetree).
Copy the last line from the command history into the console
Run the line. Now the error happens.


Event Timeline

Looks like you are referring to the standard compositing node tree? This tree is not in bpy.data.node_groups, but is stored locally in Scene, i.e. you need to access it as

bpy.data.scenes["Scene"].node_tree.nodes["Value"].outputs[0].default_value = 0.5

Only actual node groups are currently stored in bpy.data.node_groups. This is a legacy "feature" which is frequently causing trouble, but is not likely to be replaced any time soon. Using scene.node_tree works fine however for any scripting purpose. Closing this report.

Ah, after IRC discussion turns out the actual problem here is the data path generation in the info space, this produces bpy.data.node_groups for all node trees, even the integrated compo trees. Will look into that.

Unfortunately this is not nicely solvable. The RNA function responsible for constructing the ID path assumes a consistent behavior of ID data blocks, which material/scene/texture node trees break. In order to handle this we would have to pass a lot of extra arguments to RNA functions which would be very messy. Since it's not actually a critical bug (only used for report strings) i would rather accept it for now and keep as a ToDo. Eventually i'd like to get rid of nested ID data blocks, then this issue would disappear as well.

Lukas Toenne (lukastoenne) changed the task status from Unknown Status to Unknown Status.Sep 3 2013, 4:45 PM
Lukas Toenne (lukastoenne) renamed this task from Changing Node Values not working to Node info python path always uses bpy.data.node_groups collection.Dec 8 2013, 12:59 PM

◀ Merged tasks: T37733.