Page MenuHome

Add new simulation data block
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Mar 24 2020, 2:59 PM.

Details

Summary

This introduces a new id data block with type ID_SIM.

The RNA part of this change is disabled by default for now.
The corresponding cmake option is WITH_SIMULATION_DATA_BLOCK_RNA.

The new data block does not yet have an embedded node tree.
I want to add that separately.

This is part of T73324.

The set of files I changed is based on rBb0a1cf2c9ae696.
However, I had to change fewer files, because I did not add a new object type.

Diff Detail

Repository
rB Blender
Branch
simulation-data-block (branched from master)
Build Status
Buildable 7285
Build 7285: arc lint + arc unit

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Mar 24 2020, 4:14 PM

Looks fine overall.

CMakeLists.txt
327

I would recommend naming this WITH_NEW_SIMULATION_TYPE, in case it needs to be checked in more places than RNA later.

source/blender/blenkernel/intern/lib_remap.c
526 ↗(On Diff #23059)

Not needed here, this is not used as object data.

source/blender/editors/animation/anim_channels_defines.c
3053

VO -> SIM

This revision now requires changes to proceed.Mar 24 2020, 4:14 PM
  • rename WITH_SIMULATION_DATA_BLOCK_RNA to WITH_NEW_SIMULATION_TYPE
  • remove unnecessary case in lib_remap.c
  • replace VO_DS_EXPAND with SIM_DS_EXPAND
This revision is now accepted and ready to land.Mar 24 2020, 5:06 PM
  • Update for latest master
  • Merge branch 'master' into simulation-data-block

For the records, I would not mind being reviewer next time you add a new data-block… Nothing critical here, but there were some changes needed re ID management, please see notes below.

source/blender/blenkernel/intern/simulation.cc
53–63

No need to define those when default behavior is fine, just set relevant pointers to NULL in the IDType struct...

68

This is handled by generic code, do not call that here. Means that function is also useless and can be removed too.

source/blender/editors/interface/interface_templates.c
685

Browse, not Browser

@Bastien Montagne (mont29) sorry for not adding you. Will fix those issues in master.