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-22 13:35:41 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-22 13:35:41 +0300
commit2fe528424d168f124efca5d94c6b0363be49dbf3 (patch)
tree04bbd895c10e1e155a90eb53f268b593e6421e96 /source/blender/makesrna/intern/rna_object_force.c
parent101fd7ec0639c03ab017e90cb46367f50e512cbb (diff)
Cleanup: remove last G.main from RNA.
Again, we cannot actually get rid of G_MAIN global access here, so in most case just 'marked' them as valid, and added assert checks to ensure we do only work with IDs in G_MAIN in those cases.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 294597d957e..4e51f81fd89 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -97,6 +97,7 @@ static const EnumPropertyItem empty_vortex_shape_items[] = {
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
+#include "BKE_library.h"
#include "BKE_modifier.h"
#include "BKE_pointcache.h"
@@ -240,7 +241,8 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min,
PTCacheID *pid;
ListBase pidlist;
- BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
+ BLI_assert(BKE_id_is_in_gobal_main(&ob->id));
+ BKE_ptcache_ids_from_object(G_MAIN, &pidlist, ob, NULL, 0);
*min = 0;
*max = 0;
@@ -263,7 +265,8 @@ static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr)
ListBase pidlist;
int num = 0;
- BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
+ BLI_assert(BKE_id_is_in_gobal_main(&ob->id));
+ BKE_ptcache_ids_from_object(G_MAIN, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
@@ -284,7 +287,8 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v
PTCacheID *pid;
ListBase pidlist;
- BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
+ BLI_assert(BKE_id_is_in_gobal_main(&ob->id));
+ BKE_ptcache_ids_from_object(G_MAIN, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
@@ -307,7 +311,8 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max,
*min = 1;
*max = 20;
- BKE_ptcache_ids_from_object(G.main, &pidlist, ob, NULL, 0);
+ BLI_assert(BKE_id_is_in_gobal_main(&ob->id));
+ BKE_ptcache_ids_from_object(G_MAIN, &pidlist, ob, NULL, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {