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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-13 15:26:26 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-13 15:28:05 +0300
commit5ff1d845ead05ac6ef952782ebd3ed98277ef6c5 (patch)
tree9be449d931fff0a332a7e4ec8e0cc27874eca496 /source/blender/editors/physics/physics_pointcache.c
parent2002fe27d97223f241580777b1a9073755181e45 (diff)
Cleanup: moar ugly G.main removal...
Note that due to RNA get/setters issue, that one may actually add some G.main usages to the total... But at least it's not hidden anymore in a very low-level, dark corner of BKE pointcache code!
Diffstat (limited to 'source/blender/editors/physics/physics_pointcache.c')
-rw-r--r--source/blender/editors/physics/physics_pointcache.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index fc2f7e40645..53aa14d3a56 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -176,7 +176,7 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool all)
PointCache *cache = ptr.data;
ListBase pidlist;
- BKE_ptcache_ids_from_object(&pidlist, ob, baker->scene, MAX_DUPLI_RECUR);
+ BKE_ptcache_ids_from_object(baker->bmain, &pidlist, ob, baker->scene, MAX_DUPLI_RECUR);
for (PTCacheID *pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
@@ -253,13 +253,14 @@ static void ptcache_bake_cancel(bContext *C, wmOperator *op)
static int ptcache_free_bake_all_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
Base *base;
PTCacheID *pid;
ListBase pidlist;
- for (base=scene->base.first; base; base= base->next) {
- BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
+ for (base = scene->base.first; base; base = base->next) {
+ BKE_ptcache_ids_from_object(bmain, &pidlist, base->object, scene, MAX_DUPLI_RECUR);
for (pid=pidlist.first; pid; pid=pid->next) {
ptcache_free_bake(pid->cache);
@@ -383,6 +384,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot)
static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
{
+ Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
Object *ob= ptr.id.data;
@@ -390,7 +392,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
PTCacheID *pid;
ListBase pidlist;
- BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR);
+ BKE_ptcache_ids_from_object(bmain, &pidlist, ob, scene, MAX_DUPLI_RECUR);
for (pid=pidlist.first; pid; pid=pid->next) {
if (pid->cache == cache) {
@@ -410,6 +412,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
}
static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
+ Main *bmain = CTX_data_main(C);
PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
Scene *scene= CTX_data_scene(C);
Object *ob= ptr.id.data;
@@ -417,7 +420,7 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op))
PTCacheID *pid;
ListBase pidlist;
- BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR);
+ BKE_ptcache_ids_from_object(bmain, &pidlist, ob, scene, MAX_DUPLI_RECUR);
for (pid=pidlist.first; pid; pid=pid->next) {
if (pid->cache == cache) {