Maya 中 MEL/Python 中使用的 AttrFieldSliderGrp 命令

发布于 2024-10-07 06:31:44 字数 149 浏览 0 评论 0原文

我想在 Maya UI 中使用滑块移动 3D 对象的边缘。

是否可以使用 -at 标志通过 attrFieldSliderGrp 命令移动任何组件(顶点、边或面),但不能移动整个对象?

感谢您的帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

︶ ̄淡然 2024-10-14 06:31:44

使用 AttrFieldSliderGrp 命令您可以平移顶点:

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;

在此处输入图像描述

但是您无法使用 AttrFieldSliderGrp 命令平移边缘和面,因为没有 它们的 txtytz 属性。
尽管如此,还是有 polyMoveEdgepolyMoveFacetcmds.polyMoveEdge()cmds.polyMoveFacet())命令用于通过 MEL 和 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];

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];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文