Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_modifier.c
| Context not available. | |||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_softbody.h" | #include "BKE_softbody.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| if (ob->type == OB_GPENCIL) { | |||||
| /* FIXME: Shouldn't the depsgraph tagging handle this? */ | |||||
| BKE_gpencil_batch_cache_dirty(ob->data); | |||||
| } | |||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| Context not available. | |||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | ||||
| } | } | ||||
| else if (ob->type == OB_GPENCIL) { | |||||
| if (ELEM(NULL, mti->bakeModifierGP, ob, ob->data)) | |||||
| return 0; | |||||
| mti->bakeModifierGP(C, &eval_ctx, md, ob); | |||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | |||||
| } | |||||
| else { | else { | ||||
| BKE_report(reports, RPT_ERROR, "Cannot apply modifier for this object type"); | BKE_report(reports, RPT_ERROR, "Cannot apply modifier for this object type"); | ||||
| return 0; | return 0; | ||||
| Context not available. | |||||
| BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in edit mode"); | BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in edit mode"); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| else if (ob->type == OB_GPENCIL) { | |||||
| if (ob->mode != OB_MODE_OBJECT) { | |||||
| BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in paint, sculpt or edit mode"); | |||||
| return 0; | |||||
| } | |||||
| if (((ID *)ob->data)->us > 1) { | |||||
| BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data"); | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| else if (((ID *) ob->data)->us > 1) { | else if (((ID *) ob->data)->us > 1) { | ||||
| BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data"); | BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data"); | ||||
| return 0; | return 0; | ||||
| Context not available. | |||||
| for (a = 0; rna_enum_object_modifier_type_items[a].identifier; a++) { | for (a = 0; rna_enum_object_modifier_type_items[a].identifier; a++) { | ||||
| md_item = &rna_enum_object_modifier_type_items[a]; | md_item = &rna_enum_object_modifier_type_items[a]; | ||||
| if (md_item->identifier[0]) { | if (md_item->identifier[0]) { | ||||
| mti = modifierType_getInfo(md_item->value); | mti = modifierType_getInfo(md_item->value); | ||||
| Context not available. | |||||
| if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) | if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) | ||||
| if (sl->basact && sl->basact->object == ob) | if (sl->basact && sl->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); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| Context not available. | |||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| Context not available. | |||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| Context not available. | |||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| Context not available. | |||||