/* Object *ob= ctx->sim.ob; */
ParticleSystem *psys= ctx->sim.psys;
ParticleSettings *part = psys->part;
- ParticleEditSettings *pset = &scene->toolsettings->particle;
+/* ParticleEditSettings *pset = &scene->toolsettings->particle; */
int totparent=0, between=0;
int steps = (int)pow(2.0, (double)part->draw_step);
int totchild = psys->totchild;
if(ob->particlesystem.first)
((ParticleSystem *) ob->particlesystem.first)->flag |= PSYS_CURRENT;
+ else
+ ob->mode &= ~OB_MODE_PARTICLE_EDIT;
DAG_scene_sort(scene);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
{
Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
Scene *scene = CTX_data_scene(C);
-
+ int mode_orig = ob->mode;
if(!scene || !ob)
return OPERATOR_CANCELLED;
object_remove_particle_system(scene, ob);
+
+ /* possible this isn't the active object
+ * object_remove_particle_system() clears the mode on the last psys
+ * */
+ if(mode_orig & OB_MODE_PARTICLE_EDIT)
+ if((ob->mode & OB_MODE_PARTICLE_EDIT)==0)
+ if(scene->basact && scene->basact->object==ob)
+ WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
+
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
return OPERATOR_FINISHED;