ScriptSpot

Forum topic · General Scripting

Select (highlight) editable poly in modify list?

By kevinmrn · 2013-05-02

Description

How do i do this. I need my editable poly to be selected in able to use soft selection in a script...

max modify mode --go to modify panel
modPanel.setCurrentObject $.modifiers [#Editable_poly_Here_Would_be_To_Simple_...] --**HELP HERE**
subObjectLevel = 1 --go to vertex selection lev
$.useSoftSelection = true --use softsel
polyop.setVertSelection $ #{5000} --select vert
polyop.moveVert $ #all [0,0,10] useSoftSel:true --move vert influence all verts in obj

Comments (10)

Try this

kevinmrn · 2013-05-02

m = plane()
m.lengthsegs = 100
m.widthsegs = 100
convertTo m editable_poly
select m
max modify mode --go to modify panel
subObjectLevel = 1 --go to vertex selection lev
m.useSoftSelection = true
movePos = [0,0,-10]
polyop.setVertSelection m #{5000}
update m
polyop.moveVert m #all -movePos useSoftSel:true

try this.

For some reason softselection only works with the modify panel open and the edit poly as the highlighted object. The movevert must be applied on all vertices because softselection can affect all vertices (stupid? y/n). I need to be in modify mode with my editable poly selected. Though in the script above it draws a plane converts it to editable poly and there are no modifiers. In my scene there are different modifiers on all meshes... Mmh maxscript seems like a world of workarounds with (if you are lucky) one single solution.

barigazy · 2013-05-02

Use to higlight base object


max modify mode
modPanel.setCurrentObject $.baseobject

Are you try on sphere and more then one selected verts?

kevinmrn · 2013-05-03

I'm testing on a sphere yes, but in the end it should be affecting multiple meshes. Goal is to have a spline which affects these multiple meshes with softselection...

kevinmrn · 2013-05-03

Ok just tried your lines and it seems to work!

Thanks man!!

kevinmrn · 2013-05-02

Come on guys there must be someone online? Its not that hard of a question, i've been looking for a solution for ages. Because above the editable_poly there are other modifiers such as skin etc. I need to be able to select the editable poly modifier to use softselection.

Questions:

barigazy · 2013-05-02

#1.Are you use Edit_Poly modifier as first modifier and the stuck or you have more then one?
#2.Are you assigne to this modifier different name?

kevinmrn · 2013-05-02

its not the modifier I'm looking for I need the editable_poly highlighted not edit poly. Guess that answers the second question as well...

kevinmrn · 2013-05-02

I'm looking to edit from the editable poly because I have loads of models with a skin applied. So I dissable skin and always deform and then I'm looking to go back to editable_poly... Or is it possible to put the edit poly right underneath the skin?

barigazy · 2013-05-02

This time no need to jump in modify panel to perform operation.
But still i don't know why softselection not work properly

obj.baseobject.useSoftSel = on
polyop.setVertSelection obj.baseobject #{1..97}
polyop.moveVert obj.baseobject #{1..97} [0,0,10] useSoftSel:on
update obj

barigazy · 2013-05-02


obj = Sphere radius:20 segs:32
addmodifier obj (Edit_Poly())
ep = obj.modifiers[1]
max modify mode
modPanel.setCurrentObject ep
ep.useSoftSel = on
subObjectLevel = 1
ep.Select #Vertex #{1..97}
ep.MoveSelection [0,0,10]