Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-04-16 14:04:33 +0300
committerJacques Lucke <jacques@blender.org>2020-04-16 14:04:33 +0300
commitc5e2a8fbbdecf589cb883b5ee8b4455605f57413 (patch)
tree90d1af5a352009074938fbe6ed7ca2978c0a29b5
parent401ddff4107d969ffc471870dd100dafc2ec494a (diff)
-rw-r--r--source/blender/blenkernel/intern/simulation.cc21
-rw-r--r--source/blender/blenloader/intern/readfile.c1
-rw-r--r--source/blender/makesdna/DNA_simulation_types.h2
3 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index e463c3cb8bb..59a9f578e09 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -47,6 +47,9 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
+struct SimulationRuntime {
+};
+
static void simulation_init_data(ID *id)
{
Simulation *simulation = (Simulation *)id;
@@ -69,6 +72,8 @@ static void simulation_copy_data(Main *bmain, ID *id_dst, const ID *id_src, cons
(ID **)&simulation_dst->nodetree,
flag_private_id_data);
}
+
+ simulation_dst->runtime = nullptr;
}
static void simulation_make_local(Main *bmain, ID *id, const int flags)
@@ -87,6 +92,11 @@ static void simulation_free_data(ID *id)
MEM_freeN(simulation->nodetree);
simulation->nodetree = nullptr;
}
+
+ if (simulation->runtime) {
+ delete simulation->runtime;
+ simulation->runtime = nullptr;
+ }
}
void *BKE_simulation_add(Main *bmain, const char *name)
@@ -118,7 +128,12 @@ IDTypeInfo IDType_ID_SIM = {
void BKE_simulation_eval(Depsgraph *depsgraph, Simulation *simulation, Scene *scene)
{
- int current_frame = scene->r.cfra;
- float current_subframe = scene->r.subframe;
- printf("Output simulation state at frame %d + %f\n", current_frame, current_subframe);
+ Simulation *simulation_orig = (Simulation *)DEG_get_original_id(&simulation->id);
+ if (simulation_orig->runtime == nullptr) {
+ simulation_orig->runtime = new SimulationRuntime();
+ }
+ SimulationRuntime &sim_runtime = *(SimulationRuntime *)simulation_orig->runtime;
+
+ int output_scene_frame = scene->r.cfra;
+ float output_scene_subframe = scene->r.subframe;
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 0ce04d81778..c00bc272a38 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9194,6 +9194,7 @@ static void direct_link_simulation(FileData *fd, Simulation *simulation)
{
simulation->adt = newdataadr(fd, simulation->adt);
direct_link_animdata(fd, simulation->adt);
+ simulation->runtime = NULL;
}
/** \} */
diff --git a/source/blender/makesdna/DNA_simulation_types.h b/source/blender/makesdna/DNA_simulation_types.h
index 113c301bb9e..5665bfed258 100644
--- a/source/blender/makesdna/DNA_simulation_types.h
+++ b/source/blender/makesdna/DNA_simulation_types.h
@@ -31,6 +31,8 @@ typedef struct Simulation {
int flag;
int _pad1[1];
+
+ void *runtime;
} Simulation;
/* Simulation.flag */