用maya mel如何实现如下功能:得到鼠标选择的顶点的坐标? 谢谢! 20

 我来答
一块飞翔
2013-03-16
知道答主
回答量:2
采纳率:0%
帮助的人:2.8万
展开全部
用 ls -sl 获取所选取点的名称放入一个sting数组中。然后用Xform -q获取坐标。手机无力。就这么思路。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
月华天降
2018-08-23
知道答主
回答量:2
采纳率:0%
帮助的人:2119
展开全部
string $selectObj[] = `filterExpand -ex true -sm 31`;
int $numSelectObj = size($selectObj);

int $i = 0;
for($ele in $selectObj)
{
    print("v" + $i + " ");
    $pos = `pointPosition -w $ele`; //get world position
    string $posStr;
    for($co in $pos)
    {
        $posStr += " " + $co;
    }
    print($posStr);       
    print("\n");
    
    $i++;
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
sltangchun
2013-03-18 · TA获得超过228个赞
知道小有建树答主
回答量:148
采纳率:100%
帮助的人:105万
展开全部
global proc sampleContextPress()
{
float $pressPosition[] = `draggerContext -query -anchorPoint sampleContext`;
print ("Press: " + $pressPosition[0] + " " + $pressPosition[1] + " "
+ $pressPosition[2] + "\n");
}
// Procedure called on drag
global proc sampleContextDrag()
{
float $dragPosition[] = `draggerContext -query -dragPoint sampleContext`;
int $button = `draggerContext -query -button sampleContext`;
string $modifier = `draggerContext -query -modifier sampleContext`;
print ("Drag: " + $dragPosition[0] + " " + $dragPosition[1] + " "
+ $dragPosition[2]
+ " Button is " + $button + " Modifier is " + $modifier + "\n");
string $message = ($dragPosition[0] + ", " + $dragPosition[1]);
draggerContext -edit -drawString $message sampleContext;
}
// Create the dragger context
draggerContext
-pressCommand "sampleContextPress"
-dragCommand "sampleContextDrag"
-cursor "hand"
sampleContext;
// Set current tool to use the sample context created.
// Results can be seen by dragging mouse in main window
setToolTo sampleContext;
追问
你写得相当好,你能不能实现得到被选择的点的绝对坐标?
谢谢!
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
孟伊翔
2013-03-13 · TA获得超过175个赞
知道小有建树答主
回答量:525
采纳率:0%
帮助的人:385万
展开全部
是不是用鼠标右键选择快捷方式
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 2条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式