这几天都没有来了.发个MEL语言上来(转) 

2006-12-25 16:12 发布

3005 4 0
//镜像对灯光没作用,所以写一个这样的mel
//
把选择灯光的属性连接起来;

string $objects[] = `ls -sl`;
string $i,$first,$temp;
$first=$objects[0];
group;
for($i in $objects)
{
if ($i==$first)
{}
else
{

//
下行意思:LightConnectAttr("属性名字",$first,$i);
//
属性名字可以随便改成你所知道的名字
  

//
举例,可以改成shadowRaysrayDepthLimitcastSoftShadowsuseDepthMapShadows:
//LightConnectAttr("shadowRays",$first,$i);
//LightConnectAttr("rayDepthLimit",$first,$i);
//LightConnectAttr("useDepthMapShadows",$first,$i);
//
连接它们的光线跟踪阴影
  

LightConnectAttr("intensity",$first,$i);

LightConnectAttr("color",$first,$i);

}
};

proc LightConnectAttr(string $AttrLight,string $first,string $i)
{
$temp="connectAttr -f "+$first+"."+$AttrLight+" "+$i+"."+$AttrLight;
eval($temp);
}
此功能,你只需要把几个灯光选择了之后,按一下按键,它就会自动把选择的灯光连接到第一个选择的灯光的colorintensity,也可以自己添加属性,里面的解释已经说得很清楚明白
  


[此贴子已经被作者于2006-12-25 16:15:10编辑过]

楼主新帖

TA的作品 TA的主页
B Color Smilies

全部评论4

  • tal
    tal 2006-12-25 16:14:00

    //MELconLightAttr

     

    //mel用途:连接选择灯光属性

     

    //我小改了一下,大家受用

     

    //改动:

     

    //1    自动添加shelf图标

     

    //2    连接shadowColor属性

     

    //3    减肥

     

     

     

     

    global proc conLightAttr()
    {
     string $objects[] = `ls -sl`;
     string $i,$first,$temp;
     $first=$objects[0];
     group;
     for($i in $objects)
     {
      if ($i== $first){
     }
     else
     {
     LightConnectAttr("useDepthMapShadows",$first,$i);
     LightConnectAttr("shadowColor",$first,$i);
     LightConnectAttr("dmapResolution",$first,$i);
     LightConnectAttr("dmapFilterSize",$first,$i);
     LightConnectAttr("dmapBias",$first,$i);
     LightConnectAttr("intensity",$first,$i);
     LightConnectAttr("color",$first,$i);
     $temp="connectAttr -f "+$first+".lightDiffuse "+$i+".emitDiffuse";
      eval($temp);
     $temp="connectAttr -f "+$first+".lightSpecular "+$i+".emitSpecular";
      eval($temp);
     }
     };
    }
    proc LightConnectAttr(string $AttrLight,string $first,string $i)
     {
     $temp="connectAttr -f "+$first+"."+$AttrLight+" "+$i+"."+$AttrLight;
     eval($temp);
     }
    global proc addIcon_cLA()
    {
     global string $gShelfTopLevel;
     if (`tabLayout -exists $gShelfTopLevel`)
     {
      shelfButton
      -parent ($gShelfTopLevel + "|" + `tabLayout -q -st $gShelfTopLevel`)
      -label "conLightAttr"
      -iol "cL      "
      -command " conLightAttr "
      -image1 "conLightAttr.bmp";
     }
     else{
      error "You Have To open at Least One Shelf!!!";
     }
    }
    addIcon_cLA;
    conLightAttr;
  • hellowing
    hellowing 2006-12-26 22:16:00

    研究中...

  • hanbin933
    hanbin933 2006-12-26 23:47:00

    顶一个

  • bitahwen
    bitahwen 2007-1-24 18:23:00
    太复杂

你可能喜欢

这几天都没有来了.发个MEL语言上来(转) 
联系
我们
快速回复 返回顶部 返回列表