2

I wanna move the edge of 3D object with a slider in Maya UI.

Is it possible to move any component (vertex, edge or face) but not the whole object with the attrFieldSliderGrp command using -at flag?

Thank you for your help.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
cazanerd
  • 21
  • 1

1 Answers1

1

Using AttrFieldSliderGrp command you can translate a vertex:

window -title "Sliders for moving a vertex";
    polySphere;
    string $sphere[] = `select -r pSphere1.vtx[199]`;
    columnLayout;
    attrFieldSliderGrp -min -5.0 -max 5.0 -at ($sphere[0]+".pntx");
    attrFieldSliderGrp -min -5.0 -max 5.0 -at ($sphere[0]+".pnty");
    attrFieldSliderGrp -min -5.0 -max 5.0 -at ($sphere[0]+".pntz");
showWindow;

enter image description here

But you can't translate edges and faces with AttrFieldSliderGrp command because there are no tx, ty and tz attributes for them. Nonetheless, there are polyMoveEdge and polyMoveFacet (cmds.polyMoveEdge() and cmds.polyMoveFacet()) commands for moving edges and faces via MEL and Python:

polySphere -name myEdges;
select myEdges.e[199];
polyMoveEdge -t 2.0 1.0 0.7 myEdges.e[199];

polySphere -name myFaces;
select myFaces.f[200:201];
polyMoveFacet -t 1.8 0.8 1.1 myFaces.f[200:201];
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220