Maxscript ProBoolean problem with the “AddMethod”

Maxscript ProBoolean problem with the “AddMethod”

p.hubertQSU4H
Explorer Explorer
717 Views
4 Replies
Message 1 of 5

Maxscript ProBoolean problem with the “AddMethod”

p.hubertQSU4H
Explorer
Explorer
Hello everybody;

I am currently developing a script where I need the Proboolean. But I can’t get it to change the adding method. I have no problem adding my boolean and changing operation but changing the add method to “reference” (and the materials method) doesn’t work. It still keeps the default method which is “move”.

 

 

b = box pos:[ 10,10,10] isSelected:on
c = box();
ProBoolean.setoperandA b
ProBoolean.SetBoolOp b 3
ProBoolean.setoperandB b c 0 1

 

 

when I refer to the documentation the 0 is supposed to pass me the method in reference.

Anyone have a solution ?

 

Pierre

0 Likes
718 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor

@p.hubertQSU4H wrote:

 

 

b = box pos:[ 10,10,10] isSelected:on
c = box();
ProBoolean.setoperandA b
ProBoolean.SetBoolOp b 3
ProBoolean.setoperandB b c 0 1

 

 

 


I remember the problem. First, try to use Boolean2 instead:

 

 

(
	delete objects

	a = box width:20 length:20 height:20 wirecolor:green isselected:on
	b = geosphere radius:8 pos:[-10,0,0] wirecolor:orange

	max create mode

	boolObj.createBooleanObject a b 2 2
)

 

 

 

... or Boolean3:

 

 

(
	delete objects

	a = box width:20 length:20 height:20 wirecolor:green isselected:on
	b = geosphere radius:8 pos:[-10,0,0] wirecolor:orange

	max create mode

	startobjectcreation boolean3 
	bool = selection[1]
	bool.AppendOperand bool b false 
	bool.SetOperationType 2 #subtraction
)

 

 

 

boolean2 has some advantages over boolean3, but boolean3 is faster for some topologies...

 

If you need ProBoolean no matter why... I can show you how next time. But I don't recommend using ProBoolean for simple mesh geometry.

 

0 Likes
Message 3 of 5

p.hubertQSU4H
Explorer
Explorer

Hi Denis, thanks for your reply.
I've spent a lot of time on forums and your reputation precedes you.

I started using Boolean3, but the problem is that it piles up IDs when I merge my meshes. I end up with the right shaders on the right faces but with a multi sub of 400 shaders. That's why I turned to Proboolean, which will keep my multi sub clean after the operations.

I'm on a non-destructive workflow, with splines as references. And I have to apply my Boolean operations as references while keeping the ability to change my IDs at any time (at the lower level)."

chrome_2HIkjumnzj.png


I may have missed something with Boolean3 for the IDs. But if you have a solution to make Proboolean work as a reference, I'm interested.

0 Likes
Message 4 of 5

denisT.MaxDoctor
Advisor
Advisor

@p.hubertQSU4H wrote:


I started using Boolean3, but the problem is that it piles up IDs when I merge my meshes.


did you try both material options?

 

.materialOption: integer

The Material setting for the Boolean:

0 - Apply Operand Material

1 - Retain Original Material

0 Likes
Message 5 of 5

denisT.MaxDoctor
Advisor
Advisor

@p.hubertQSU4H wrote:


I may have missed something with Boolean3 for the IDs. But if you have a solution to make Proboolean work as a reference, I'm interested.


 

fn setAddMethodByHWND method = 
(
	hwnd = windows.getchildhwnd #max "Start Picking"
	hwnd = hwnd[1]
	for k = 0 to method do hwnd = uiaccessor.getnextwindow hwnd
	uiaccessor.pressbutton hwnd
)

(
	delete objects

	a = box width:20 length:20 height:20 wirecolor:green isselected:on
	b = geosphere radius:8 pos:[-10,0,0] wirecolor:orange

	max modify mode

	proboolean.createBooleanObject a undefined 2 0 0
	select a
	hwnd = windows.getchildhwnd #max "Start Picking"
	add_method = 0 -- reference
	setAddMethodByHWND add_method
	proboolean.SetOperandB a b add_method 0
	modpanel.setcurrentobject a	
)

 

0 Likes