4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * Contributor(s): Blender Foundation, 2009
25 * ***** END GPL LICENSE BLOCK *****
32 #include "MEM_guardedalloc.h"
34 #include "DNA_curve_types.h"
35 #include "DNA_mesh_types.h"
36 #include "DNA_meshdata_types.h"
37 #include "DNA_modifier_types.h"
38 #include "DNA_object_types.h"
39 #include "DNA_object_force.h"
40 #include "DNA_scene_types.h"
42 #include "BLI_listbase.h"
44 #include "BKE_curve.h"
45 #include "BKE_context.h"
46 #include "BKE_depsgraph.h"
47 #include "BKE_displist.h"
48 #include "BKE_DerivedMesh.h"
49 #include "BKE_effect.h"
50 #include "BKE_global.h"
51 #include "BKE_lattice.h"
53 #include "BKE_modifier.h"
54 #include "BKE_multires.h"
55 #include "BKE_report.h"
56 #include "BKE_object.h"
57 #include "BKE_particle.h"
58 #include "BKE_softbody.h"
59 #include "BKE_utildefines.h"
61 #include "RNA_access.h"
62 #include "RNA_define.h"
63 #include "RNA_enum_types.h"
65 #include "ED_screen.h"
70 #include "object_intern.h"
72 /******************************** API ****************************/
74 int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int type)
77 ModifierTypeInfo *mti = modifierType_getInfo(type);
79 if(mti->flags&eModifierTypeFlag_Single) {
80 if(modifiers_findByType(ob, type)) {
81 BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed.");
86 if(type == eModifierType_ParticleSystem) {
87 object_add_particle_system(scene, ob);
90 if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
91 md = ob->modifiers.first;
93 while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform)
96 BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
99 BLI_addtail(&ob->modifiers, modifier_new(type));
102 if(type == eModifierType_Softbody) {
104 ob->soft= sbNew(scene);
105 ob->softflag |= OB_SB_GOAL|OB_SB_EDGES;
108 else if(type == eModifierType_Collision) {
110 ob->pd= object_add_collision_fields();
113 DAG_scene_sort(scene);
115 else if(type == eModifierType_Surface)
116 DAG_scene_sort(scene);
119 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
124 int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
128 /* It seems on rapid delete it is possible to
129 * get called twice on same modifier, so make
130 * sure it is in list. */
131 for(obmd=ob->modifiers.first; obmd; obmd=obmd->next)
139 if(md->type == eModifierType_ParticleSystem) {
140 ParticleSystemModifierData *psmd=(ParticleSystemModifierData*)md;
142 BLI_remlink(&ob->particlesystem, psmd->psys);
143 psys_free(ob, psmd->psys);
145 else if(md->type == eModifierType_Softbody) {
152 else if(md->type == eModifierType_Collision) {
156 DAG_scene_sort(scene);
158 else if(md->type == eModifierType_Surface) {
160 ob->pd->flag &= ~PFIELD_SURFACE;
162 DAG_scene_sort(scene);
165 BLI_remlink(&ob->modifiers, md);
168 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
173 int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md)
176 ModifierTypeInfo *mti = modifierType_getInfo(md->type);
178 if(mti->type!=eModifierTypeType_OnlyDeform) {
179 ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type);
181 if(nmti->flags&eModifierTypeFlag_RequiresOriginalData) {
182 BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data.");
187 BLI_remlink(&ob->modifiers, md);
188 BLI_insertlink(&ob->modifiers, md->prev->prev, md);
194 int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *md)
197 ModifierTypeInfo *mti = modifierType_getInfo(md->type);
199 if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
200 ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type);
202 if(nmti->type!=eModifierTypeType_OnlyDeform) {
203 BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier.");
208 BLI_remlink(&ob->modifiers, md);
209 BLI_insertlink(&ob->modifiers, md->next, md);
215 int ED_object_modifier_convert(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
218 ParticleSystem *psys;
219 ParticleCacheKey *key, **cache;
220 ParticleSettings *part;
225 int totvert=0, totedge=0, cvert=0;
226 int totpart=0, totchild=0;
228 if(md->type != eModifierType_ParticleSystem) return 0;
229 if(G.f & G_PARTICLEEDIT) return 0;
231 psys=((ParticleSystemModifierData *)md)->psys;
234 if(part->ren_as == PART_DRAW_GR || part->ren_as == PART_DRAW_OB) {
235 ; // XXX make_object_duplilist_real(NULL);
238 if(part->ren_as != PART_DRAW_PATH || psys->pathcache == 0)
241 totpart= psys->totcached;
242 totchild= psys->totchildcache;
244 if(totchild && (part->draw&PART_DRAW_PARENT)==0)
248 cache= psys->pathcache;
249 for(a=0; a<totpart; a++) {
251 totvert+= key->steps+1;
252 totedge+= key->steps;
255 cache= psys->childcache;
256 for(a=0; a<totchild; a++) {
258 totvert+= key->steps+1;
259 totedge+= key->steps;
262 if(totvert==0) return 0;
265 obn= add_object(scene, OB_MESH);
268 me->totvert= totvert;
269 me->totedge= totedge;
271 me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
272 me->medge= CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
273 me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, 0);
278 /* copy coordinates */
279 cache= psys->pathcache;
280 for(a=0; a<totpart; a++) {
283 for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
284 VECCOPY(mvert->co,key->co);
288 medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
294 cache=psys->childcache;
295 for(a=0; a<totchild; a++) {
298 for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
299 VECCOPY(mvert->co,key->co);
303 medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
310 DAG_scene_sort(scene);
315 int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
322 BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in editmode");
324 } else if (((ID*) ob->data)->us>1) {
325 BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data");
329 if (md!=ob->modifiers.first)
330 BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected.");
332 if (ob->type==OB_MESH) {
334 BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to Mesh with Shape Keys");
338 mesh_pmv_off(ob, me);
340 /* Multires: ensure that recent sculpting is applied */
341 if(md->type == eModifierType_Multires)
342 multires_force_update(ob);
344 dm = mesh_create_derived_for_modifier(scene, ob, md);
346 BKE_report(reports, RPT_ERROR, "Modifier is disabled or returned error, skipping apply");
355 else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
356 ModifierTypeInfo *mti = modifierType_getInfo(md->type);
357 Curve *cu = ob->data;
359 float (*vertexCos)[3];
361 BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tesselated/bevel vertices");
363 if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md))) {
364 BKE_report(reports, RPT_ERROR, "Modifier is disabled, skipping apply");
368 vertexCos = curve_getVertexCos(cu, &cu->nurb, &numVerts);
369 mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0, 0);
370 curve_applyVertexCos(cu, &cu->nurb, vertexCos);
374 MEM_freeN(vertexCos);
376 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
379 BKE_report(reports, RPT_ERROR, "Cannot apply modifier for this object type");
384 BLI_remlink(&ob->modifiers, md);
393 int ED_object_modifier_copy(ReportList *reports, Object *ob, ModifierData *md)
397 nmd = modifier_new(md->type);
398 modifier_copyData(md, nmd);
399 BLI_insertlink(&ob->modifiers, md, nmd);
404 /***************************** OPERATORS ****************************/
406 /************************ add modifier operator *********************/
408 static int modifier_add_exec(bContext *C, wmOperator *op)
410 Scene *scene= CTX_data_scene(C);
411 Object *ob = CTX_data_active_object(C);
412 int type= RNA_enum_get(op->ptr, "type");
414 if(!ED_object_modifier_add(op->reports, scene, ob, type))
415 return OPERATOR_CANCELLED;
417 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
419 return OPERATOR_FINISHED;
422 void OBJECT_OT_modifier_add(wmOperatorType *ot)
425 ot->name= "Add Modifier";
426 ot->description = "Add a modifier to the active object.";
427 ot->idname= "OBJECT_OT_modifier_add";
430 ot->invoke= WM_menu_invoke;
431 ot->exec= modifier_add_exec;
433 ot->poll= ED_operator_object_active;
436 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
438 /* XXX only some types should be here */
439 RNA_def_enum(ot->srna, "type", modifier_type_items, 0, "Type", "");
442 /************************ remove modifier operator *********************/
444 static int modifier_remove_exec(bContext *C, wmOperator *op)
446 Scene *scene= CTX_data_scene(C);
447 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
448 Object *ob= ptr.id.data;
449 ModifierData *md= ptr.data;
451 if(!ob || !md || !ED_object_modifier_remove(op->reports, scene, ob, md))
452 return OPERATOR_CANCELLED;
454 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
456 return OPERATOR_FINISHED;
459 void OBJECT_OT_modifier_remove(wmOperatorType *ot)
461 ot->name= "Remove Modifier";
462 ot->description= "Remove a modifier from the active object.";
463 ot->idname= "OBJECT_OT_modifier_remove";
464 ot->poll= ED_operator_object_active;
466 ot->exec= modifier_remove_exec;
469 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
472 /************************ move up modifier operator *********************/
474 static int modifier_move_up_exec(bContext *C, wmOperator *op)
476 Scene *scene= CTX_data_scene(C);
477 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
478 Object *ob= ptr.id.data;
479 ModifierData *md= ptr.data;
481 if(!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md))
482 return OPERATOR_CANCELLED;
484 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
485 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
487 return OPERATOR_FINISHED;
490 void OBJECT_OT_modifier_move_up(wmOperatorType *ot)
492 ot->name= "Move Up Modifier";
493 ot->description= "Move modifier up in the stack.";
494 ot->idname= "OBJECT_OT_modifier_move_up";
495 ot->poll= ED_operator_object_active;
497 ot->exec= modifier_move_up_exec;
500 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
503 /************************ move down modifier operator *********************/
505 static int modifier_move_down_exec(bContext *C, wmOperator *op)
507 Scene *scene= CTX_data_scene(C);
508 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
509 Object *ob= ptr.id.data;
510 ModifierData *md= ptr.data;
512 if(!ob || !md || !ED_object_modifier_move_down(op->reports, ob, md))
513 return OPERATOR_CANCELLED;
515 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
516 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
518 return OPERATOR_FINISHED;
521 void OBJECT_OT_modifier_move_down(wmOperatorType *ot)
523 ot->name= "Move Down Modifier";
524 ot->description= "Move modifier down in the stack.";
525 ot->idname= "OBJECT_OT_modifier_move_down";
526 ot->poll= ED_operator_object_active;
528 ot->exec= modifier_move_down_exec;
531 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
534 /************************ apply modifier operator *********************/
536 static int modifier_apply_exec(bContext *C, wmOperator *op)
538 Scene *scene= CTX_data_scene(C);
539 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
540 Object *ob= ptr.id.data;
541 ModifierData *md= ptr.data;
543 if(!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md))
544 return OPERATOR_CANCELLED;
546 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
547 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
549 return OPERATOR_FINISHED;
552 void OBJECT_OT_modifier_apply(wmOperatorType *ot)
554 ot->name= "Apply Modifier";
555 ot->description= "Apply modifier and remove from the stack.";
556 ot->idname= "OBJECT_OT_modifier_apply";
557 ot->poll= ED_operator_object_active;
559 ot->exec= modifier_apply_exec;
562 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
565 /************************ convert modifier operator *********************/
567 static int modifier_convert_exec(bContext *C, wmOperator *op)
569 Scene *scene= CTX_data_scene(C);
570 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
571 Object *ob= ptr.id.data;
572 ModifierData *md= ptr.data;
574 if(!ob || !md || !ED_object_modifier_convert(op->reports, scene, ob, md))
575 return OPERATOR_CANCELLED;
577 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
578 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
580 return OPERATOR_FINISHED;
583 void OBJECT_OT_modifier_convert(wmOperatorType *ot)
585 ot->name= "Convert Modifier";
586 ot->description= "Convert particles to a mesh object.";
587 ot->idname= "OBJECT_OT_modifier_convert";
588 ot->poll= ED_operator_object_active;
590 ot->exec= modifier_convert_exec;
593 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
596 /************************ copy modifier operator *********************/
598 static int modifier_copy_exec(bContext *C, wmOperator *op)
600 Scene *scene= CTX_data_scene(C);
601 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
602 Object *ob= ptr.id.data;
603 ModifierData *md= ptr.data;
605 if(!ob || !md || !ED_object_modifier_copy(op->reports, ob, md))
606 return OPERATOR_CANCELLED;
608 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
609 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
611 return OPERATOR_FINISHED;
614 void OBJECT_OT_modifier_copy(wmOperatorType *ot)
616 ot->name= "Copy Modifier";
617 ot->description= "Duplicate modifier at the same position in the stack.";
618 ot->idname= "OBJECT_OT_modifier_copy";
619 ot->poll= ED_operator_object_active;
621 ot->exec= modifier_copy_exec;
624 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
627 /****************** multires subdivide operator *********************/
629 static int multires_subdivide_exec(bContext *C, wmOperator *op)
631 PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier);
632 Object *ob= ptr.id.data;
633 MultiresModifierData *mmd= ptr.data;
636 multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple);
637 WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
640 return OPERATOR_FINISHED;
643 void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
645 ot->name= "Multires Subdivide";
646 ot->description= "Add a new level of subdivision.";
647 ot->idname= "OBJECT_OT_multires_subdivide";
648 ot->poll= ED_operator_object_active;
650 ot->exec= multires_subdivide_exec;
653 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
656 /************************ mdef bind operator *********************/
658 static int modifier_mdef_bind_poll(bContext *C)
660 return CTX_data_pointer_get_type(C, "modifier", &RNA_MeshDeformModifier).data != NULL;
663 static int modifier_mdef_bind_exec(bContext *C, wmOperator *op)
665 Scene *scene= CTX_data_scene(C);
666 PointerRNA ptr= CTX_data_pointer_get(C, "modifier");
667 Object *ob= ptr.id.data;
668 MeshDeformModifierData *mmd= ptr.data;
671 if(mmd->bindweights) MEM_freeN(mmd->bindweights);
672 if(mmd->bindcos) MEM_freeN(mmd->bindcos);
673 if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
674 if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
675 if(mmd->dynverts) MEM_freeN(mmd->dynverts);
676 mmd->bindweights= NULL;
679 mmd->dyninfluences= NULL;
683 mmd->totinfluence= 0;
687 int mode= mmd->modifier.mode;
689 /* force modifier to run, it will call binding routine */
691 mmd->modifier.mode |= eModifierMode_Realtime;
693 if(ob->type == OB_MESH) {
694 dm= mesh_create_derived_view(scene, ob, 0);
697 else if(ob->type == OB_LATTICE) {
698 lattice_calc_modifiers(scene, ob);
700 else if(ob->type==OB_MBALL) {
701 makeDispListMBall(scene, ob);
703 else if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
704 makeDispListCurveTypes(scene, ob, 0);
708 mmd->modifier.mode= mode;
711 return OPERATOR_FINISHED;
714 void OBJECT_OT_modifier_mdef_bind(wmOperatorType *ot)
717 ot->name= "Mesh Deform Bind";
718 ot->description = "Bind mesh to cage in mesh deform modifier.";
719 ot->idname= "OBJECT_OT_modifier_mdef_bind";
722 ot->poll= modifier_mdef_bind_poll;
723 ot->exec= modifier_mdef_bind_exec;
726 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
730 static void modifiers_add(void *ob_v, int type)
733 ModifierTypeInfo *mti = modifierType_getInfo(type);
735 if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
736 ModifierData *md = ob->modifiers.first;
738 while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) {
742 BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
744 BLI_addtail(&ob->modifiers, modifier_new(type));
746 ED_undo_push("Add modifier");
749 typedef struct MenuEntry {
754 static int menuEntry_compare_names(const void *entry1, const void *entry2)
756 return strcmp(((MenuEntry *)entry1)->name, ((MenuEntry *)entry2)->name);
759 static uiBlock *modifiers_add_menu(void *ob_v)
765 MenuEntry entries[NUM_MODIFIER_TYPES];
767 block= uiNewBlock(&curarea->uiblocks, "modifier_add_menu",
768 UI_EMBOSSP, UI_HELV, curarea->win);
769 uiBlockSetButmFunc(block, modifiers_add, ob);
771 for (i=eModifierType_None+1; i<NUM_MODIFIER_TYPES; i++) {
772 ModifierTypeInfo *mti = modifierType_getInfo(i);
774 /* Only allow adding through appropriate other interfaces */
775 if(ELEM(i, eModifierType_ParticleSystem, eModifierType_Surface)) continue;
777 if((mti->flags&eModifierTypeFlag_AcceptsCVs) ||
778 (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) {
779 entries[numEntries].name = mti->name;
780 entries[numEntries].ID = i;
786 qsort(entries, numEntries, sizeof(*entries), menuEntry_compare_names);
789 for(i = 0; i < numEntries; ++i)
790 uiDefBut(block, BUTM, B_MODIFIER_RECALC, entries[i].name,
791 0, yco -= 20, 160, 19, NULL, 0, 0, 1, entries[i].ID, "");
793 uiTextBoundsBlock(block, 50);
794 uiBlockSetDirection(block, UI_DOWN);
801 static void modifiers_clearHookOffset(bContext *C, void *ob_v, void *md_v)
804 ModifierData *md = md_v;
805 HookModifierData *hmd = (HookModifierData*) md;
808 Mat4Invert(hmd->object->imat, hmd->object->obmat);
809 Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
810 ED_undo_push(C, "Clear hook offset");
814 static void modifiers_cursorHookCenter(bContext *C, void *ob_v, void *md_v)
818 ModifierData *md = md_v;
819 HookModifierData *hmd = (HookModifierData*) md;
822 float *curs = give_cursor();
823 float bmat[3][3], imat[3][3];
827 Mat3CpyMat4(bmat, ob->obmat);
831 hmd->cent[0]= curs[0]-ob->obmat[3][0];
832 hmd->cent[1]= curs[1]-ob->obmat[3][1];
833 hmd->cent[2]= curs[2]-ob->obmat[3][2];
834 Mat3MulVecfl(imat, hmd->cent);
836 ED_undo_push(C, "Hook cursor center");
840 static void modifiers_selectHook(bContext *C, void *ob_v, void *md_v)
842 /* XXX ModifierData *md = md_v;
843 HookModifierData *hmd = (HookModifierData*) md;
848 static void modifiers_reassignHook(bContext *C, void *ob_v, void *md_v)
850 /* XXX ModifierData *md = md_v;
851 HookModifierData *hmd = (HookModifierData*) md;
853 int *indexar, tot, ok;
856 ok= hook_getIndexArray(&tot, &indexar, name, cent);
859 uiPupMenuError(C, "Requires selected vertices or active Vertex Group");
862 MEM_freeN(hmd->indexar);
865 VECCOPY(hmd->cent, cent);
866 hmd->indexar = indexar;
871 void modifiers_explodeFacepa(bContext *C, void *arg1, void *arg2)
873 ExplodeModifierData *emd=arg1;
875 emd->flag |= eExplodeFlag_CalcFaces;
878 void modifiers_explodeDelVg(bContext *C, void *arg1, void *arg2)
880 ExplodeModifierData *emd=arg1;