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/makesrna
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/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_object.c4
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c23
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c19
3 files changed, 25 insertions, 21 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 107b3f6ad57..bd2d8e98bb0 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -752,11 +752,11 @@ static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int val
psys_set_current_num(ob, value);
}
-static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
+static void rna_Object_particle_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->id.data;
- PE_current_changed(scene, ob);
+ PE_current_changed(bmain, scene, ob);
}
/* rotation - axis-angle */
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 2b0740bff6f..294597d957e 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -95,13 +95,14 @@ static const EnumPropertyItem empty_vortex_shape_items[] = {
#include "DNA_texture_types.h"
#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_global.h"
#include "BKE_modifier.h"
#include "BKE_pointcache.h"
-#include "BKE_depsgraph.h"
#include "ED_object.h"
-static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+static void rna_Cache_change(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object *)ptr->id.data;
PointCache *cache = (PointCache *)ptr->data;
@@ -113,7 +114,7 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
cache->flag |= PTCACHE_OUTDATED;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(bmain, &pidlist, ob, NULL, 0);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -132,7 +133,7 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
BLI_freelistN(&pidlist);
}
-static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+static void rna_Cache_toggle_disk_cache(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object *)ptr->id.data;
PointCache *cache = (PointCache *)ptr->data;
@@ -142,7 +143,7 @@ static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene
if (!ob)
return;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(bmain, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache)
@@ -158,7 +159,7 @@ static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene
BLI_freelistN(&pidlist);
}
-static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+static void rna_Cache_idname_change(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object *)ptr->id.data;
PointCache *cache = (PointCache *)ptr->data;
@@ -171,7 +172,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
/* TODO: check for proper characters */
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(bmain, &pidlist, ob, NULL, 0);
if (cache->flag & PTCACHE_EXTERNAL) {
for (pid = pidlist.first; pid; pid = pid->next) {
@@ -239,7 +240,7 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min,
PTCacheID *pid;
ListBase pidlist;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
*min = 0;
*max = 0;
@@ -262,7 +263,7 @@ static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr)
ListBase pidlist;
int num = 0;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
@@ -283,7 +284,7 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v
PTCacheID *pid;
ListBase pidlist;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
@@ -306,7 +307,7 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max,
*min = 1;
*max = 20;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 2bc188212fe..11610c35b34 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -40,8 +40,9 @@
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "BKE_paint.h"
+#include "BKE_main.h"
#include "BKE_material.h"
+#include "BKE_paint.h"
#include "ED_image.h"
@@ -103,10 +104,11 @@ const EnumPropertyItem rna_enum_symmetrize_direction_items[] = {
#include "MEM_guardedalloc.h"
#include "BKE_context.h"
+#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
-#include "BKE_pointcache.h"
+#include "BKE_global.h"
#include "BKE_particle.h"
-#include "BKE_depsgraph.h"
+#include "BKE_pointcache.h"
#include "BKE_pbvh.h"
#include "GPU_buffers.h"
@@ -152,10 +154,10 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
}
-static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
+static void rna_ParticleEdit_redo(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
{
Object *ob = (scene->basact) ? scene->basact->object : NULL;
- PTCacheEdit *edit = PE_get_current(scene, ob);
+ PTCacheEdit *edit = PE_get_current(bmain, scene, ob);
if (!edit)
return;
@@ -190,7 +192,8 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerR
Scene *scene = CTX_data_scene(C);
Object *ob = (scene->basact) ? scene->basact->object : NULL;
#if 0
- PTCacheEdit *edit = PE_get_current(scene, ob);
+ Main *bmain = CTX_data_main(C);
+ PTCacheEdit *edit = PE_get_current(bmain, scene, ob);
ParticleSystem *psys = edit ? edit->psys : NULL;
#else
/* use this rather than PE_get_current() - because the editing cache is
@@ -215,14 +218,14 @@ static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
{
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
- return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object));
+ return (pset->object && pset->scene && PE_get_current(G.main, pset->scene, pset->object));
}
static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
{
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
if (pset->scene) {
- PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
+ PTCacheEdit *edit = PE_get_current(G.main, pset->scene, pset->object);
return (edit && edit->psys);
}