[Closed] What wrong with my ProBoolean maxscript?
Here is my proboolean maxscript.
b=box();
b.pos=[10,10,10]
c=box();
ProBoolean.CreateBooleanObject b c 2 0 1; --2 mean Subtraction ,0 mean Reference, 1 mean Retain Original Material
create two boxes: b & c;
cut b with c , but retain the c (do not remove it)
but c disappear after execute it.
And when i look at the config of my ProBoolean,
it said it used “move”, but i want “reference” .
how can i fix it?
thx
it’s one of a stupid bugs in MAX which for any reason max’s developers don’t want to fix over the time of four years. Here is a workaround:
fn getBooleanHWND =
(
hwnd = undefined
for c in (windows.getChildrenHWND #max) while hwnd == undefined where c[4] == "RollupPanelTitle" and c[5] == "Pick Boolean" do
(
hwnd = UIAccessor.GetParentWindow c[1]
)
hwnd
)
fn setAddMethod method hwnd: update:on =
(
if hwnd == unsupplied do hwnd = getBooleanHWND()
if hwnd != undefined do
(
name = case method of
(
0: "Reference"
1: "Copy"
2: "Move"
3: "Instance"
default: "Copy"
)
if (bt = windows.getChildHWND hwnd name) != undefined do UIAccessor.PressButton bt[1]
if update do select selection
ok
)
)
delete objects
b = box pos:[ 10,10,10] isSelected:on
c = box();
ProBoolean.setoperandA b
select b
if getCommandPanelTaskMode() != #modify do setCommandPanelTaskMode mode:#modify
if setAddMethod 0 == ok do
(
ProBoolean.SetBoolOp b 2
ProBoolean.setoperandB b c 0 1
select b
)
hey,
i´m stuggling with the same problem …
your workaround isnt working for me all i get is a ProBoolean object with standard setting and Box01 (b) as Operand A.
maybe i´m doing something wrong?
my workaround atm is to set up one ProBoolean Object by hand and running my script after that. the settings i´ve done by hand are kept for all other ProBoolean operations made by scripts.
Anyways, I would appreciate a better solution
froyd
it works for me in max 2009 and max 2010… does it set add method to “Reference”?
hey Denis,
sry, i forgot to mention: I´m using max 2008.
It works in max 2009, method is set to “Reference”, it does not in max 2010 (method = “Move”)