Page MenuHome

Bpy/Python is letting create inputs at the node level for node groups that make blend file unsaveable
Closed, ResolvedPublic

Description

System Information
Operating system: Linux-4.15.0-46-generic-x86_64-with-Ubuntu-18.04-bionic 64 Bits
Graphics card: Radeon RX Vega ATI Technologies Inc. 4.5.13542 Core Profile Context 18.50.1.418

Blender Version
Broken: version: 2.80 (sub 49)
Worked: Create the inputs at the node_tree level
Short description of error
bpy is letting create inputs at the node level for node groups that make blend file unsaveable by crashing blender saving.

Exact steps for others to reproduce the error

  1. Go to compositor view
  2. Create a group by adding a Mix node and then group it
  3. Execute this line in the python console
bpy.context.scene.node_tree.nodes['Group'].inputs.new('NodeSocketColor','stuff')
  1. the node now has a new input, but then entering the group the new input is not there
  2. save, here it crashes and it doesn't save the file.

The blend file is in step 2)

Event Timeline

Confirmed, bpy.context.scene.node_tree.nodes['Group'].node_tree.inputs.new('NodeSocketColor','stuff') is working as expected (the direct access from Group node's inputs should be a shortcut to that one I think, or not allow this operation at all, checking code…)

Bastien Montagne (mont29) triaged this task as Confirmed, Medium priority.

I'm pretty sure that this is not supposed to work.
I actually don't know the API to add sockets to groups, but I guess it has to be done "from the inside".

@Jacques Lucke (JacquesLucke) I think this is fairly easy to add (just call the function adding sockets to group's nodetree instead in RNA code), trying it currently…

It's nice to hear you say that something is easy, related to node trees haha