Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_object.c
| Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| int mode_orig; | int mode_orig; | ||||
| if (!scene || !ob) { | if (!scene || !ob) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| mode_orig = ob->mode; | mode_orig = ob->mode; | ||||
| object_remove_particle_system(bmain, scene, ob); | ParticleSystem *psys = psys_get_current(ob); | ||||
| object_remove_particle_system(bmain, scene, ob, psys); | |||||
| /* possible this isn't the active object | /* possible this isn't the active object | ||||
| * object_remove_particle_system() clears the mode on the last psys | * object_remove_particle_system() clears the mode on the last psys | ||||
| */ | */ | ||||
| if (mode_orig & OB_MODE_PARTICLE_EDIT) { | if (mode_orig & OB_MODE_PARTICLE_EDIT) { | ||||
| if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) { | if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) { | ||||
| if (view_layer->basact && view_layer->basact->object == ob) { | if (view_layer->basact && view_layer->basact->object == ob) { | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL); | WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL); | ||||
| ▲ Show 20 Lines • Show All 1,227 Lines • Show Last 20 Lines | |||||