2010年9月19日

记得有一朋友问怎么显示多边形顶点坐标,写了一MEL

忘了是哪个帖子问的了,刚想起来,用MEL写了一套,选择模型执行脚本就可以了。原理的就是用粒子position加上goal顶点,很简单,不知道是不是那位朋友需要的结果。string $selpoly1[] =`ls -sl`;int $numss[]=`polyEvaluate -v $selpoly1[0]`;print $numss[0];string $pps[]=`particle -jbp 0 0 0 -nj ($numss[0]) -jr 0 -c 1 `;select -r $pps[0];select -tgl $selpoly1[0] ;goal -w 1 -utr 0 -g $selpoly1[0] $pps[0];playButtonStepForward ;select -r $pps[0];saveInitialState $pps[0] ;playButtonStepBackward;setAttr ($pps[1]+".particleRenderType") 2;addAttr -is true -ln "pointSize" -at long -min 1 -max 60 -dv 2 $pps[1];addAttr -is true -ln "selectedOnly" -at bool -dv false $pps[1];addAttr -is true -dt "string" -ln "attributeName" $pps[1];setAttr -type "string" ($pps[1]+".attributeName") "position";

沒有留言:

張貼留言