PDA

View Full Version : What wrong with my ProBoolean maxscript?


gohkgohk
09-12-2009, 04:37 PM
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

denisT
09-12-2009, 05:41 PM
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
)

froyd
09-23-2009, 03:30 PM
hey,

im 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 im doing something wrong?

my workaround atm is to set up one ProBoolean Object by hand and running my script after that. the settings ive done by hand are kept for all other ProBoolean operations made by scripts.

Anyways, I would appreciate a better solution :)


froyd

denisT
09-23-2009, 04:16 PM
it works for me in max 2009 and max 2010... does it set add method to "Reference"?

froyd
09-28-2009, 11:20 AM
hey Denis,

sry, i forgot to mention: Im using max 2008.
It works in max 2009, method is set to "Reference", it does not in max 2010 (method = "Move")

CGTalk Moderation
09-28-2009, 11:20 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.