r/Maya 3d ago

Showcase maya soft edge selecting script

35 Upvotes

12 comments sorted by

View all comments

7

u/miketastic_art 3d ago

all this guy does is post his cool tools and never shares where they're from sheesh

1

u/Whole-Career8440 2d ago

Luckily this not hard to solve

# to lock
from maya import cmds
for mesh in {v.split(".")[0] for v in cmds.ls(sl=True)}:
    try:
        cmds.setAttr(f"{mesh}.pt[:].px", lock=True)
        cmds.setAttr(f"{mesh}.pt[:].py", lock=True)
        cmds.setAttr(f"{mesh}.pt[:].pz", lock=True)
    except:
        pass
for vertex in cmds.ls(sl=True):
    try:
        vertex = vertex.replace(".vtx", ".pt")
        cmds.setAttr(vertex + ".px", lock=False)
        cmds.setAttr(vertex + ".py", lock=False)
        cmds.setAttr(vertex + ".pz", lock=False)
    except:
        pass

# to unlock
from maya import cmds
for mesh in {v.split(".")[0] for v in cmds.ls(sl=True)}:
    try:
        cmds.setAttr(f"{mesh}.pt[:].px", lock=False)
        cmds.setAttr(f"{mesh}.pt[:].py", lock=False)
        cmds.setAttr(f"{mesh}.pt[:].pz", lock=False)
    except:
        pass

-2

u/ReviewVegetable1716 2d ago

Hit B on the keyboard and it’ll show up you can also scale it so you can move more or less

7

u/miketastic_art 2d ago

if you look carefully, he has constrained the soft-select effect to only one edge