ScriptSpot

Forum topic · General Scripting

how to use cut tool (editable poly) with maxscript

By popa_3d · 2011-12-27

Description

Hi! I am new here and new to maxscript and I want to say that this is an excellent site :) and I am a big fan my problem is I want to use cut tool (editable poly with max script) but didn't succes following maxscript documentation the cut fuction have 4 arguments

polyOp.cutVert Poly poly int start_vert point3 destination point3 projdir

I didn't understand what is exactelly projdir

I want to developpe a script that is able to cut a polygonal surface converted from a spline I already write a script it work but not in all case in this one I used createEdge but I want to replace it by cut... here is the code

macroScript fixspolyspline_y category:"popa_3d"

(

on isEnabled return

selection.count == 1 and classof selection[1].baseobject == Editable_Poly

on execute do

(

obj = selection[1]

p= polyOp.getNumVerts obj

n=0
w=0
v=0
s=0
d=0

q=0
for i=1 to p do(
for j=1 to p do(

a = [n,w,v]
b = [q,s,d]

a= polyOp.getVert obj i
b= polyOp.getVert obj j

if a.y == b.y then(
obj.createEdge i j)
)

)
)
)

see the image to see what script do

Attachments
Comments (3)

Re

popa_3d · 2012-01-01

Amazing the cut tool is exactelly what I wanted to do thank you very much LittleLordPotala :)

PS thanks to you also miauu your script is very usefull in my work also ;)

Your script with cut tool :

LittleLordPotala · 2011-12-29

See the attached files.

You can change the threshold value as needed.
Choose the axis with the on_X and on_Y variables.

The projdir argument is the point of view
and in your case, you cut on X and Y axis, so it's the top view [0,0,1].

Best regards.

Attachments