2010-08-23 108 views
4

如何找到在Autodesk Maya中的中心點...我知道用中心樞紐,但我無法找到point..how準確的找到了使用Autodesk創建的3D對象的座標瑪雅?謝謝。查找在Autodesk Maya中中心點

+0

我有一個腳本,只是這樣做任何選擇,如果你有興趣我可以告訴你它是如何工作的(其基本上相同的系統,我假設中心樞軸獲取其定位信息,因爲它總是返回與它相同的位置。) – SacredGeometry 2011-12-05 02:19:45

回答

0

在Maya中選擇對象,並期待在右側面板中。

3

只要進入菜單,修改>中心樞紐。這將使你的樞軸轉到你的模型的中心。

0

選擇對象,然後在腳本編輯器中運行以下命令:

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

這將打印在X,Y和在歷史面板Z座標。

1

如果你滿意的地方中心轉動命令把樞軸,你只是想知道在世界空間是,你可以做以下(假設你有選擇的對象)

使用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) 

或使用MEL

xform -q -rotatePivot 
1

實際上,有一個名爲objectCenter()

命令這會給你一個特定的點或對象的真實世界空間。

進口maya.cmds作爲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

2

實際上有兩個可能的答案的問題。

對象的「中心」可能意味着:

對象的邊框的中心:你能得到這個如下(使用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 

的位置對象軸:這是不一樣的物體的位置,因爲你可以在不改變瑪雅報告變換號碼移動支點。世界空間的樞軸位置可以得到:

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

選擇對象,然後選擇:動畫>創建變形金剛>羣集。

簇變形現在會出現在一個目標的準確中心,由「C」表示,可以頂點捕捉到任何你需要有中心的集羣。集羣的實際中心點將低於'C'。

0

選擇對象,「修改-中心樞紐..「 如果不工作,只需選擇對象,然後按'插入鍵,在您的鑰匙 板,然後它將允許您設置樞軸..只需拖放你想設置的地方...

如果您有任何疑問隨時分享....