I wanna move the edge of 3D object with a slider in Maya UI.
Is it possible to move any component (vertex,开发者_如何学Python edge or face) but not the whole object with the attrFieldSliderGrp
command using -at
flag?
Thank you for your help.
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;
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];
精彩评论