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_sculpt_paint.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_sculpt_paint.c')
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 11610c35b34..87f8537df4e 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -218,14 +218,20 @@ static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
{
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
- return (pset->object && pset->scene && PE_get_current(G.main, pset->scene, pset->object));
+ if (pset->object != NULL && pset->scene != NULL) {
+ BLI_assert(BKE_id_is_in_gobal_main(&pset->object->id));
+ BLI_assert(BKE_id_is_in_gobal_main(&pset->scene->id));
+ }
+ 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(G.main, pset->scene, pset->object);
+ BLI_assert(BKE_id_is_in_gobal_main(&pset->scene->id));
+ BLI_assert(BKE_id_is_in_gobal_main(&pset->object->id));
+ PTCacheEdit *edit = PE_get_current(G_MAIN, pset->scene, pset->object);
return (edit && edit->psys);
}