Page Menu
Home
Search
Configure Global Search
Log In
Files
F1052
boolmodmenu.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Johnny Matthews (guitargeek)
Nov 13 2013, 12:53 PM
Size
2 KB
Subscribers
None
boolmodmenu.patch
View Options
Index: source/blender/src/editobject.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editobject.c,v
retrieving revision 1.244
diff -u -r1.244 editobject.c
--- source/blender/src/editobject.c 6 Sep 2005 09:47:30 -0000 1.244
+++ source/blender/src/editobject.c 6 Sep 2005 16:24:49 -0000
@@ -159,7 +159,7 @@
#include "nla.h"
#include "blendef.h"
-
+#include "butspace.h"
#include "BIF_transform.h"
#include "BIF_poseobject.h"
@@ -1973,7 +1973,7 @@
if (me && ob->id.lib==NULL) {
// Bring up a little menu with the boolean operation choices on.
- nr= pupmenu("Boolean %t|Intersect%x1|Union%x2|Difference%x3");
+ nr= pupmenu("Boolean %t|Intersect%x1|Union%x2|Difference%x3|Intersect Modifier%x4|Union Modifier%x5|Difference Modifier%x6");
if (nr > 0) {
// user has made a choice of a menu element.
// All of the boolean functions require 2 mesh objects
@@ -1988,16 +1988,42 @@
if (base_select) {
if (get_mesh(base_select->object)) {
- waitcursor(1);
- ret = NewBooleanMesh(BASACT,base_select,nr);
- if (ret==0) {
- error("An internal error occurred -- sorry!");
- } else if(ret==-1) {
- error("Selected meshes must have faces to perform boolean operations");
- }
- else BIF_undo_push("Boolean");
+ if(nr <= 3){
+ waitcursor(1);
+ ret = NewBooleanMesh(BASACT,base_select,nr);
+ if (ret==0) {
+ error("An internal error occurred -- sorry!");
+ } else if(ret==-1) {
+ error("Selected meshes must have faces to perform boolean operations");
+ }
+ else BIF_undo_push("Boolean");
+
+ waitcursor(0);
+ } else {
+ ModifierTypeInfo *mti = modifierType_getInfo(eModifierType_Boolean);
+ BooleanModifierData *boolmod = NULL;
+ boolmod = (BooleanModifierData *)modifier_new(eModifierType_Boolean);
+ if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
+ ModifierData *md = ob->modifiers.first;
- waitcursor(0);
+ while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) {
+ md = md->next;
+ }
+ BLI_insertlinkbefore(&ob->modifiers, md, boolmod);
+ } else {
+ BLI_addtail(&ob->modifiers, boolmod);
+ }
+ boolmod->object = base_select->object;
+ boolmod->modifier.mode |= eModifierMode_Realtime;
+ switch(nr){
+ case 4: boolmod->operation = 0; break;
+ case 5: boolmod->operation = 1; break;
+ case 6: boolmod->operation = 2; break;
+ default: boolmod->operation = 0;
+ }
+ do_common_editbuts(B_CHANGEDEP);
+ BIF_undo_push("Add Boolean modifier");
+ }
} else {
error("Please select 2 meshes");
}
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
97/b9/a4fbbcfd927fe2d916d80a3475e4
Event Timeline
Log In to Comment