bugfix [#21055] Python: accessing ParticleEdit.hair causes segmentation violation

This commit is contained in:
2010-02-09 20:03:05 +00:00
parent 0d2b080358
commit 4768c33dbb
2 changed files with 5 additions and 4 deletions

View File

@@ -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
{

View File

@@ -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 */