[Closed] how to make this plugin?
I am a newbie for MaxScript.
I want to use MaxScript to create a cube on all selected vertex of Object (A)
and perform boolean operation with the new generated cube and the Object (A) one by one.
Can anyone make it for me ?
Or provide some ideas to create a cube on all selected vertex?
thank you so much
Try this. (not tested)
Sel_Verts = for i in $Object_A.selectedVerts collect i.index
NewObject = copy $Object_A
for j in Sel_Verts do
(
Vert_Pos = getVert $Object_A.mesh j
New_Box = Box()
New_Box.position = Vert_Pos
New_Object = New_Object - New_Box
)
Try This, just select the vertex and run the script.
obj = selection[1]
converttoMesh obj
boxArray = #()
for i in (getVertSelection obj) do
(
pos = getVert obj i
b = box()
b.pivot = b.center
b.pos = pos
append boxArray b
)
ProBoolean.CreateBooleanObjects obj boxArray 0 2 1
How can i use EditPolyMod instead of converttoMesh for obj?
i want to retain the original parameter control on the object.
Can i do it?
thx
obj = selection[1]
boxArray = #()
for i in (polyop.getVertSelection obj) do
(
pos = polyop.getVert obj i
b = box()
b.pivot = b.center
b.pos = pos
append boxArray b
)
ProBoolean.CreateBooleanObjects obj boxArray 0 2 1
proBoolean.createBooleanObjects returns new (or old if “move” method was used) object. That object can be converted to poly.
obj = proBoolean.createBooleanObjects objA objB op addMethod matMethod
converttopoly obj
tried that but: <Deleted scene node>
also tried
convertto (ProBoolean.CreateBooleanObjects obj selectionArray 0 2 1) Editable_Poly
– No ““convertTo”” function for OK
any idea ?
i forgot about that, while creating proboolean we used move method which deletes the actual node so we get deleted node.
Sorry i’m not on my system right now, so i don’t have the ans. i’ll reply after i check it.
ain’t the same thing with this ?
convertto (ProBoolean.CreateBooleanObjects obj selectionArray 0 2 1) Editable_Poly
– No ““convertTo”” function for OK
tried that:
obj = proBoolean.createBooleanObjects objA objB op addMethod matMethod
converttopoly obj
the same… – No ““convertTo”” function for OK
any other idea ?
I was wrong. createBooleanObject returns OK.
After applying createBooleanObject objA becames ProBoolean object and it can be converted to poly:
a = box width:10 length:10 height:10
b = box width:10 length:10 height:10 pos:[5,5,5]
proBoolObj.createBooleanObject a b 0 2 1
converttopoly a