Notifications
Clear all

[Closed] Soft selection

Hello, I have a problem with soft selection.

There is a simple script:

subobjectlevel = 1
$.usesoftselection=on
$.falloff=10
$.pinch=0
$.bubble=0
$.setselection #vertex #{10..15}
polyop.movevert $ #all [0,0,10] useSoftSel:true

When I run this script with the Create tab open, then all vertices are moved. It only works when I have the Modify tab open (and it is not the matter of baseObject or another modifier selected)… How to use the soft selection in maxscript properly?

8 Replies
1 Reply
(@gazybara)
Joined: 10 months ago

Posts: 0

Try this way

subobjectlevel = 1
$.usesoftselection=on
$.falloff=10
$.pinch=0
$.bubble=0
$.setselection #vertex #{10..15}
polyop.movevert $ #selection [0,0,10] useSoftSel:true

--or 

subobjectlevel = 1
$.usesoftselection=on
$.falloff=10
$.pinch=0
$.bubble=0
$.selectedverts = #{10..15}
polyop.movevert $ #{10..15} [0,0,10] useSoftSel:true

I’ve tried this, doesn’t work.

2 Replies
(@gazybara)
Joined: 10 months ago

Posts: 0

Both examples works. (same for create and modify panel).
You don’t need to use “selectionlevel = 1” for this operation.

(@denist)
Joined: 10 months ago

Posts: 0

it doesn’t work for me too. but i’m absolutely sure that it worked. i have some tools those use this technique but they stopped working. i have no idea why.

in both max 2010/64 and 2012/64 it doesn’t work anymore. not in Direct3d, not in Nitrous…

 PEN

If it doesn’t work what is the error or the result that you are seeing from running that code?

As a note I would never use $ in code. It can result in issues as it can return an object or an array of objects.

You might want to beef it up a bit with something like


if selection.count==1 and classOf selection[1]==editable_poly do
(
   obj=selection[1]
   --From here use obj.blablabla instead of $.blablabla
)


There’s no error, look at the pictures below:

I’ve already wrote my own soft sel function, but it’s not the demon of speed, I would like to use the built-in soft selection :hmm:

max modify mode

This at the beginning of the script ?

In max2013x64 works.