Page MenuHome

Embed simulation node tree in simulation data block
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 1 2020, 12:17 PM.

Details

Summary

This also shows the node tree in the Simulation Editor.
There is a new operator to add a simulation.

One debatable aspect of this patch is how I integrated the SpaceNodeEditor.simulation
property in RNA. I decided to wrap the existing id property, because the description
says Data-block whose nodes are being edited, which is exactly what is happening here.

I'm also not sure if more changes are necessary for the node tree embedding. I feels too easy. Maybe @Bastien Montagne (mont29) can give me a hint?
For now it behaves as I'd expect, but since I can't do much with the data block yet, I cannot test many things.

This is how the header in the Simulation Editor (node editor) looks like:

This is part of T73324.

Diff Detail

Repository
rB Blender
Branch
embedded_simulation_node_tree (branched from master)
Build Status
Buildable 7483
Build 7483: arc lint + arc unit

Event Timeline

  • update for latest master
Bastien Montagne (mont29) requested changes to this revision.Apr 6 2020, 3:10 PM

Generally LGTM from quick look, besides one obvious thing missing: handling of this new nodetree in lib_query.c code... ;)

Also discovered something very suspicious in copying code, but that seems to be shared by existing code as well, so will investigate that separately.

source/blender/blenkernel/intern/simulation.cc
64–67

Uuuuuhhhhh… This call looks horribly suspicious to me, looks like it is creating the copy of nodetree in bmain…

But this is not related to that patch, others (material e.g.) do the same, so that's something I’ll have to check outside of it…

This revision now requires changes to proceed.Apr 6 2020, 3:10 PM
  • handle node tree in lib_query.c
source/blender/blenkernel/intern/simulation.cc
64–67

Please let me know when you fixed that in master. I'll update this patch afterwards.

  • add simulation node trees to node tree iterator
  • Merge branch 'simulation-tree-arc' into embedded_simulation_node_tree
Bastien Montagne (mont29) added inline comments.
source/blender/blenkernel/intern/simulation.cc
64–67

Actually you can scratch that, had to look again at the code, but we ensure that LIB_EMBEDDED_DATA IDs are never added to the bmain (they get special treatment in BKE_libblock_copy_ex()...).

This revision is now accepted and ready to land.Apr 9 2020, 11:53 AM