在 Autodesk Maya 中查找中心点

发布于 2024-09-15 17:39:50 字数 92 浏览 7 评论 0原文

如何在 Autodesk Maya 中找到中心点...我知道使用中心枢轴,但我找不到该点..如何找到使用 Autodesk Maya 创建的 3D 对象的确切坐标?谢谢。

how to find the centre point in autodesk maya...I know use the centre pivot but i can't find the point..how to find the exact coordinate of the 3d object created using autodesk maya? thanks.

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

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

发布评论

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

评论(8

装迷糊 2024-09-22 17:39:50

只需进入菜单,修改>中心枢轴。这将使您的枢轴转到模型的中心。

Just go to the menus, Modify > Center Pivot. This will make your pivot go to the center of your model.

痴意少年 2024-09-22 17:39:50

这个问题实际上有两种可能的答案。

对象的“中心”可能意味着:

对象边界框的中心:您可以按如下方式获得(使用 python)

bbx = cmds.xform(object, q=True, bb=True, ws=True) # world space
centerX = (bbx[0] + bbx[3]) / 2.0
centerY = (bbx[1] + bbx[4]) / 2.0
centerZ = (bbx[2] + bbx[5]) / 2.0

对象枢轴的位置:这与对象的位置不同,因为您可以移动轴而不更改 Maya 报告的平移编号。世界空间枢轴位置可以通过以下方式获得:

pivot = cmds.xform(object, q=True, rp=True, ws=True)

There are actually two possible answers to the question.

The 'center' of the object could mean:

The center of the object's bounding box : you could get this as follows (using python)

bbx = cmds.xform(object, q=True, bb=True, ws=True) # world space
centerX = (bbx[0] + bbx[3]) / 2.0
centerY = (bbx[1] + bbx[4]) / 2.0
centerZ = (bbx[2] + bbx[5]) / 2.0

the location of the object's pivot: This is not the same as the object's position, since you can move the pivot without changing the translation number that maya reports. The world-space pivot location can be gotten with:

pivot = cmds.xform(object, q=True, rp=True, ws=True)
怪我太投入 2024-09-22 17:39:50

如果您对中心枢轴命令放置枢轴的位置感到满意,并且只想知道它在世界空间中的位置,则可以

使用 PyMEL 执行以下操作(假设您已选择对象):

import pymel.core as pm
theObject = pm.ls(sl=1)[0]
theObject.getRotatePivot()

或使用 maya.cmds:

import maya.cmds as mc
mc.xform(query=True,rotatePivot=True)

或使用梅尔

xform -q -rotatePivot

If you're happy with where the center pivot command puts the pivot and you just want to know where in worldspace it is, you could do the following (assuming you have the object selected)

using PyMEL:

import pymel.core as pm
theObject = pm.ls(sl=1)[0]
theObject.getRotatePivot()

or using maya.cmds:

import maya.cmds as mc
mc.xform(query=True,rotatePivot=True)

or using MEL

xform -q -rotatePivot
并安 2024-09-22 17:39:50

实际上有一个名为 objectCenter() 的命令,

这将为您提供特定点或对象的真实世界空间。

将 maya.cmds 导入为 cmd

# create a simple hierarchy
cmds.polyCube( name='a' )
cmds.polyCube( name='b' )
cmds.parent( 'b', 'a' )
cmds.move( 3, 0, 0, 'a', localSpace=True )
cmds.move( 2, 2, 2, 'b', localSpace=True )
X_COORD = cmds.objectCenter('b',x=True)
# Result: 5 #
# Get the center of the bounding box of b in local space
XYZ = cmds.objectCenter('b', l=True)
# Result: 2 2 2 #
# Get the center of the bounding box of b in world space
XYZ = cmds.objectCenter('b', gl=True)
# Result: 5 2 2 #
# Get the center of the bounding box of a in world space
XYZ = cmds.objectCenter('a', gl=True)

http://download.autodesk.com /global/docs/maya2013/en_us/CommandsPython/index.html

香农

There's actually a command called objectCenter()

This will give you true world space of a specific point or object.

import maya.cmds as cmds

# create a simple hierarchy
cmds.polyCube( name='a' )
cmds.polyCube( name='b' )
cmds.parent( 'b', 'a' )
cmds.move( 3, 0, 0, 'a', localSpace=True )
cmds.move( 2, 2, 2, 'b', localSpace=True )
X_COORD = cmds.objectCenter('b',x=True)
# Result: 5 #
# Get the center of the bounding box of b in local space
XYZ = cmds.objectCenter('b', l=True)
# Result: 2 2 2 #
# Get the center of the bounding box of b in world space
XYZ = cmds.objectCenter('b', gl=True)
# Result: 5 2 2 #
# Get the center of the bounding box of a in world space
XYZ = cmds.objectCenter('a', gl=True)

http://download.autodesk.com/global/docs/maya2013/en_us/CommandsPython/index.html

Shannon

っ〆星空下的拥抱 2024-09-22 17:39:50

选择对象并选择:动画>动画创建变形器>簇。

现在,簇变形器将出现在对象的精确中心,用“C”表示,您可以将顶点捕捉到需要居中的任何簇。簇的实际中心点将位于“C”下方。

Select the object and select: Animation > Create Deformers > Cluster.

A cluster deformer will now appear at the exact center of your object, denoted by a 'C', you can vertex-snap to the cluster whatever you need to have centered. The actual centerpoint of the cluster will be just below the 'C'.

独自←快乐 2024-09-22 17:39:50

在 Maya 中选择对象并在右侧面板中查看。

In maya select object and look in panel on the right.

倥絔 2024-09-22 17:39:50

选择对象,然后在脚本编辑器中运行此命令:

string $sel[];
$sel = `ls -sl`;
print `getAttr ($sel[0]+".translate")`;

这将在历史记录面板中打印 X、Y 和 Z 坐标。

Select the object, and then run this in the script editor:

string $sel[];
$sel = `ls -sl`;
print `getAttr ($sel[0]+".translate")`;

This will print the X, Y, and Z coordinates in the history panel.

夏末染殇 2024-09-22 17:39:50

选择对象“修改中心轴..”
如果不起作用,只需选择对象并按“插入键”,在您的键中
木板。然后它将允许您设置枢轴..只需拖放您要设置的位置...

如果您有任何疑问,请随时分享....

Select the object, "Modify-Center pivot.."
In case of not working, just select the object and press 'Insert key, in your key
board. then it will allow you to set pivot..just drag and drop the place where u want to set...

If you have any doubt feel free to share....

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