diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-08 16:41:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-08 16:49:17 +0300 |
commit | 6f96dfabe5cbf6966282decd2307ade9aacdeaee (patch) | |
tree | 01529fbad8453faf81a62877d03373eaf0b77b57 /source/blender/makesrna/intern/rna_modifier.c | |
parent | bf4198cdaf7d4fa1a5f91526fb6bbe84d2fa2a37 (diff) |
Simulations: initial simulation state and cache
The current particle state is stored in a `CustomData` instance and
the cache is stored in `PointCache`.
The current state exists on the copy-on-write copies of the simulation,
while the cache only exists in the original data block.
This patch implements a temporary trivial particle simulation that does not
use the node system yet. It is used for testing and will be replaced soon.
`PointCache` still has some limitations that need to be overcome using
separate refactorings. For example, we need to be able to store the number
of particles in the point cache. Also we need to change which attributes
are stored for a particle system more dynamically than is currently possible afaik.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7836
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index b8dad8cf5c1..a0026797c68 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -29,6 +29,7 @@ #include "DNA_object_force_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_simulation_types.h" #include "MEM_guardedalloc.h" @@ -1631,6 +1632,17 @@ static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr, CLAMP_MIN(psmd->psys, 1); } +# ifdef WITH_NEW_SIMULATION_TYPE +static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + SimulationModifierData *smd = ptr->data; + if (smd->simulation != NULL) { + DEG_id_tag_update(&smd->simulation->id, ID_RECALC_ALL); + } + rna_Modifier_dependency_update(bmain, scene, ptr); +} +# endif + #else /* NOTE: *MUST* return subdivision_type property. */ @@ -6794,7 +6806,7 @@ static void rna_def_modifier_simulation(BlenderRNA *brna) prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Simulation", "Simulation to access"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_SimulationModifier_simulation_update"); # endif prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); |