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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-09-26 18:24:29 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-09-26 18:27:43 +0300
commitcf2c09002fae1e5b11acc0f21b67ffb29212ad7a (patch)
tree5b8b93171e8c9b838a504563888cc48bc91024e3 /source/blender/makesrna/intern/rna_sculpt_paint.c
parent6a33e3b990f39f20ae075fecf29aaa968932c989 (diff)
Fix T69488: Hair particles: rekey disolves the hair then crashes
Caused by rB914427afd512. Since above commit 'pe_get_current' checks for an active depsgraph. This caused the skipping of handling `PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL`for everything calling `PE_get_current` (this passes a NULL depsgraph as opposed to `PE_create_current`). So we now pass a depsgraph here as well... Note there are two RNA cases where we pass NULL, namely - rna_ParticleEdit_editable_get - rna_ParticleEdit_hair_get I guess these should be fine though (no functional change to current master) Reviewers: sergey Maniphest Tasks: T69488 Differential Revision: https://developer.blender.org/D5752
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, 6 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index ef550a079ad..eb411538b41 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -204,10 +204,11 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
{
+ Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
- PTCacheEdit *edit = PE_get_current(scene, ob);
+ PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
if (!edit) {
return;
@@ -259,8 +260,9 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
# if 0
+ Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Scene *scene = CTX_data_scene(C);
- PTCacheEdit *edit = PE_get_current(scene, ob);
+ PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
ParticleSystem *psys = edit ? edit->psys : NULL;
# else
/* use this rather than PE_get_current() - because the editing cache is
@@ -285,14 +287,14 @@ static bool 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(NULL, pset->scene, pset->object));
}
static bool 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(NULL, pset->scene, pset->object);
return (edit && edit->psys);
}