bugfix [#21055] Python: accessing ParticleEdit.hair causes segmentation violation
This commit is contained in:
@@ -579,6 +579,7 @@ void unlink_object(Scene *scene, Object *ob)
|
||||
if(sce->id.lib==NULL) {
|
||||
if(sce->camera==ob) sce->camera= NULL;
|
||||
if(sce->toolsettings->skgen_template==ob) sce->toolsettings->skgen_template = NULL;
|
||||
if(sce->toolsettings->particle.object==ob) sce->toolsettings->particle.object= NULL;
|
||||
|
||||
#ifdef DURIAN_CAMERA_SWITCH
|
||||
{
|
||||
|
||||
@@ -191,7 +191,7 @@ int PE_start_edit(PTCacheEdit *edit)
|
||||
|
||||
ParticleEditSettings *PE_settings(Scene *scene)
|
||||
{
|
||||
return &scene->toolsettings->particle;
|
||||
return scene->toolsettings ? &scene->toolsettings->particle : NULL;
|
||||
}
|
||||
|
||||
/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set
|
||||
@@ -205,12 +205,12 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
|
||||
ListBase pidlist;
|
||||
PTCacheID *pid;
|
||||
|
||||
if(pset==NULL || pset->object==NULL)
|
||||
return NULL;
|
||||
|
||||
pset->scene = scene;
|
||||
pset->object = ob;
|
||||
|
||||
if(ob==NULL)
|
||||
return NULL;
|
||||
|
||||
BKE_ptcache_ids_from_object(&pidlist, ob);
|
||||
|
||||
/* in the case of only one editable thing, set pset->edittype accordingly */
|
||||
|
||||
Reference in New Issue
Block a user