一半君的总结纸

听话只听一半君

#67 如何控制当前的显示层(active Display Layer)的可见状态(visibility)?

快速的去 MEL Command Reference 里搜了下,发现下面几个命令可以用来方位 Display Layer 的信息:

createDisplayLayer
editDisplayLayerGlobals
editDisplayLayerMembers

上面的第二个命令可以用来查询或设置当前的 Display Layer; 比如:

string $currentDisplayLayer = `editDisplayLayerGlobals -q -currentDisplayLayer`;
// Result: defaultLayer //

一个Display Layer的 visibility 是和Maya里其他node一样由 ‘.visibility’ 属性控制的; 如:

setAttr defaultLayer.visibility true;

所以, 要切换当前的Display Layer的 visibility 的话:

string $currentDisplayLayer = `editDisplayLayerGlobals -q -currentDisplayLayer`;

string $visAttr = ( $currentDisplayLayer + ".visibility" );

setAttr $visAttr ( !`getAttr $visAttr` );

Related How-To’s

Monday, May 21, 2001

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: