Simulations: Embed simulation node tree in simulation data block
This adds an embedded node tree to the simulation data block dna. The UI in the `Simulation Editor` has been updated to show a list of simulation data blocks, instead of individual node trees. The new `SpaceNodeEditor.simulation` property wraps the existing `SpaceNodeEditor.id` property. It allows scripts to get and set the simulation data block that is being edited. Reviewers: brecht, mont29 Differential Revision: https://developer.blender.org/D7301
This commit is contained in:
@@ -151,6 +151,14 @@ class NODE_HT_header(Header):
|
||||
if snode_id:
|
||||
layout.prop(snode_id, "use_nodes")
|
||||
|
||||
elif snode.tree_type == 'SimulationNodeTree':
|
||||
row = layout.row(align=True)
|
||||
row.prop(snode, "simulation", text="")
|
||||
row.operator("simulation.new", text="", icon='ADD')
|
||||
simulation = snode.simulation
|
||||
if simulation:
|
||||
row.prop(snode.simulation, "use_fake_user", text="")
|
||||
|
||||
else:
|
||||
# Custom node tree is edited as independent ID block
|
||||
NODE_MT_editor_menus.draw_collapsible(context, layout)
|
||||
|
Reference in New Issue
Block a user