45
44
#include "DNA_screen_types.h"
46
45
#include "DNA_meta_types.h"
47
46
#include "DNA_object_types.h"
47
#include "DNA_scene_types.h"
48
48
#include "DNA_view3d_types.h"
50
50
#include "BKE_utildefines.h"
254
/* if(base->lay & G.vd->lay) { */
256
for(a=0; a<hits; a++) {
257
/* index converted for gl stuff */
258
if(ml->selcol==buffer[ 4 * a + 3 ]) act= ml;
261
for(a=0; a<hits; a++) {
262
/* index converted for gl stuff */
263
if(ml->selcol1==buffer[ 4 * a + 3 ]){
264
ml->flag |= MB_SCALE_RAD;
267
if(ml->selcol2==buffer[ 4 * a + 3 ]){
268
ml->flag &= ~MB_SCALE_RAD;
324
339
makeDispList(G.obedit);
325
340
allqueue(REDRAWVIEW3D, 0);
326
341
allqueue(REDRAWBUTSEDIT, 0);
343
BIF_undo_push("Delete MetaElem");
346
/* free all MetaElems from ListBase */
347
void freeMetaElemlist(ListBase *lb)
361
lb->first= lb->last= NULL;
365
/* ************* undo for MetaBalls ************* */
367
static void undoMball_to_editMball(void *lbv)
370
MetaElem *ml, *newml;
371
unsigned int nr, lastmlnr= 0;
373
/* we try to restore lastelem, which used in for example in button window */
374
for(ml= editelems.first; ml; ml= ml->next, lastmlnr++)
375
if(lastelem==ml) break;
377
freeMetaElemlist(&editelems);
379
/* copy 'undo' MetaElems to 'edit' MetaElems */
382
newml= MEM_dupallocN(ml);
383
BLI_addtail(&editelems, newml);
387
for(nr=0, lastelem= editelems.first; lastelem; lastelem= lastelem->next, nr++)
388
if(nr==lastmlnr) break;
392
static void *editMball_to_undoMball(void)
395
MetaElem *ml, *newml;
397
/* allocate memory for undo ListBase */
398
lb= MEM_callocN(sizeof(ListBase), "listbase undo");
399
lb->first= lb->last= NULL;
401
/* copy contents of current ListBase to the undo ListBase */
404
newml= MEM_dupallocN(ml);
405
BLI_addtail(lb, newml);
412
/* free undo ListBase of MetaElems */
413
static void free_undoMball(void *lbv)
417
freeMetaElemlist(lb);
421
/* this is undo system for MetaBalls */
422
void undo_push_mball(char *name)
424
undo_editmode_push(name, free_undoMball, undoMball_to_editMball, editMball_to_undoMball);
427
/* Hide selected/unselected MetaElems */
428
void hide_mball(char hide)
436
if(!(ml->flag & SELECT))
440
if(ml->flag & SELECT)
446
makeDispList(G.obedit);
447
allqueue(REDRAWVIEW3D, 0);
448
allqueue(REDRAWBUTSEDIT, 0);
450
BIF_undo_push("Hide MetaElems");
453
/* Unhide all edited MetaElems */
454
void reveal_mball(void)
461
ml->flag &= ~MB_HIDE;
465
makeDispList(G.obedit);
466
allqueue(REDRAWVIEW3D, 0);
467
allqueue(REDRAWBUTSEDIT, 0);
469
BIF_undo_push("Unhide MetaElems");