[Bf-blender-cvs] [87e9557cd10] master: Simulations: pass simulation data block to update function
Jacques Lucke
noreply at git.blender.org
Mon May 25 12:24:07 CEST 2020
Commit: 87e9557cd109dc9a3d52f07b509a340bba4aaf20
Author: Jacques Lucke
Date: Mon May 25 12:23:03 2020 +0200
Branches: master
https://developer.blender.org/rB87e9557cd109dc9a3d52f07b509a340bba4aaf20
Simulations: pass simulation data block to update function
===================================================================
M source/blender/blenkernel/BKE_simulation.h
M source/blender/blenkernel/intern/simulation.cc
M source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_simulation.h b/source/blender/blenkernel/BKE_simulation.h
index d1cf782e9e5..534ddfe1271 100644
--- a/source/blender/blenkernel/BKE_simulation.h
+++ b/source/blender/blenkernel/BKE_simulation.h
@@ -27,7 +27,9 @@ struct Depsgraph;
void *BKE_simulation_add(struct Main *bmain, const char *name);
-void BKE_simulation_data_update(struct Depsgraph *depsgraph, struct Scene *scene);
+void BKE_simulation_data_update(struct Depsgraph *depsgraph,
+ struct Scene *scene,
+ struct Simulation *simulation);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index 50770125a18..d5ba345928b 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -18,6 +18,8 @@
* \ingroup bke
*/
+#include <iostream>
+
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
@@ -46,6 +48,7 @@
#include "BLT_translation.h"
#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
static void simulation_init_data(ID *id)
{
@@ -122,6 +125,8 @@ void *BKE_simulation_add(Main *bmain, const char *name)
return simulation;
}
-void BKE_simulation_data_update(Depsgraph *UNUSED(depsgraph), Scene *UNUSED(scene))
+void BKE_simulation_data_update(Depsgraph *UNUSED(depsgraph),
+ Scene *UNUSED(scene),
+ Simulation *UNUSED(simulation))
{
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index f76af5bdda5..7a562190cfd 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1766,10 +1766,13 @@ void DepsgraphNodeBuilder::build_simulation(Simulation *simulation)
build_animdata(&simulation->id);
build_parameters(&simulation->id);
+ Simulation *simulation_cow = get_cow_datablock(simulation);
+ Scene *scene_cow = get_cow_datablock(scene_);
+
add_operation_node(&simulation->id,
NodeType::SIMULATION,
OperationCode::SIMULATION_EVAL,
- function_bind(BKE_simulation_data_update, _1, get_cow_datablock(scene_)));
+ function_bind(BKE_simulation_data_update, _1, scene_cow, simulation_cow));
}
void DepsgraphNodeBuilder::build_scene_sequencer(Scene *scene)
More information about the Bf-blender-cvs
mailing list