[Bf-blender-cvs] [1cb2f3a1c15] simulation-access-modifier: add BKE_simulation_data_update function
Jacques Lucke
noreply at git.blender.org
Mon Apr 27 13:35:21 CEST 2020
Commit: 1cb2f3a1c15ab422ae2f68ba74aa3d9094df2fff
Author: Jacques Lucke
Date: Mon Apr 27 13:34:48 2020 +0200
Branches: simulation-access-modifier
https://developer.blender.org/rB1cb2f3a1c15ab422ae2f68ba74aa3d9094df2fff
add BKE_simulation_data_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 aad0ada75a9..d1cf782e9e5 100644
--- a/source/blender/blenkernel/BKE_simulation.h
+++ b/source/blender/blenkernel/BKE_simulation.h
@@ -23,9 +23,12 @@ extern "C" {
struct Main;
struct Simulation;
+struct Depsgraph;
void *BKE_simulation_add(struct Main *bmain, const char *name);
+void BKE_simulation_data_update(struct Depsgraph *depsgraph, struct Scene *scene);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index ace91424764..c227ecb8778 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -22,6 +22,7 @@
#include "DNA_ID.h"
#include "DNA_defaults.h"
+#include "DNA_scene_types.h"
#include "DNA_simulation_types.h"
#include "BLI_compiler_compat.h"
@@ -44,6 +45,8 @@
#include "BLT_translation.h"
+#include "DEG_depsgraph.h"
+
static void simulation_init_data(ID *id)
{
Simulation *simulation = (Simulation *)id;
@@ -108,3 +111,8 @@ IDTypeInfo IDType_ID_SIM = {
/* free_data */ simulation_free_data,
/* make_local */ nullptr,
};
+
+void BKE_simulation_data_update(Depsgraph *depsgraph, Scene *scene)
+{
+ printf("Eval simulation: %d + %f\n", scene->r.cfra, scene->r.subframe);
+}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 748abf49b53..25037fbd1b5 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -97,6 +97,7 @@ extern "C" {
#include "BKE_scene.h"
#include "BKE_sequencer.h"
#include "BKE_shader_fx.h"
+#include "BKE_simulation.h"
#include "BKE_sound.h"
#include "BKE_tracking.h"
#include "BKE_volume.h"
@@ -1714,7 +1715,7 @@ void DepsgraphNodeBuilder::build_simulation(Simulation *simulation)
add_operation_node(&simulation->id,
NodeType::SIMULATION,
OperationCode::SIMULATION_EVAL,
- [](struct ::Depsgraph *UNUSED(depsgraph)) { printf("Eval Simulation\n"); });
+ function_bind(BKE_simulation_data_update, _1, get_cow_datablock(scene_)));
}
void DepsgraphNodeBuilder::build_scene_sequencer(Scene *scene)
More information about the Bf-blender-cvs
mailing list