3dsmax脚本-VRay灯光控制

rollout LightTool  " VRay灯光控制 "  width: 192  height: 309
(
    groupBox AllLight 
" 全部灯光 "  pos:[ 16 , 16 ] width: 77  height: 160
    button TurnOnAllLight 
" 开灯 "  pos:[ 24 , 32 ] width: 60  height: 25
    button TurnOffAllLight 
" 关灯 "  pos:[ 24 , 72 ] width: 60  height: 25
    groupBox grp2 
" 所选灯光 "  pos:[ 101 , 16 ] width: 72  height: 160
    button TurnOnSelectedLight 
" 开灯 "  pos:[ 107 , 32 ] width: 60  height: 25
    button TurnOffSelectedLight 
" 关灯 "  pos:[ 107 , 72 ] width: 60  height: 25
    groupBox grp3 
""  pos:[ 8 , 8 ] width: 176  height: 256
    groupBox grp4 
" 灯光强度控制 "  pos:[ 16 , 184 ] width: 160  height: 72
    button ShowAllLight 
" 显示 "  pos:[ 24 , 107 ] width: 60  height: 25
    button HideAllLight 
" 隐藏 "  pos:[ 24 , 142 ] width: 60  height: 25
    button HideSelectedLight 
" 隐藏 "  pos:[ 107 , 104 ] width: 60  height: 64
    label lbl1 
" 改动前: "  pos:[ 32 , 200 ] width: 56  height: 16
    editText edt1 
""  pos:[ 96 , 200 ] width: 70  height: 16  enabled: false
    spinner mu 
""  pos:[ 104 , 224 ] width: 62  height: 16  range:[ 0 , 2000 , 1 ] type:# float  scale: 1
    label lbl2 
" 当前值: "  pos:[ 32 , 224 ] width: 56  height: 16
    label lbl3 
" VRay灯光控制工具 "  pos:[ 61 , 279 ] width: 123  height: 19
    
    
/* 在脚本载入时文本框显示已经选择的灯光的倍增值 */
    on LightTool open  
do  
(
        
for  x  in  selection  do  

        
if  superclassof x == light then

        
        edt1.text
= x.multiplier  as   string
    )
    on TurnOnAllLight pressed  
do
(
        
for  x  in  lights  where  classof x != targetobject  do

         x.on
= true
    )
    on TurnOffAllLight pressed  
do
(
        
for  x  in  lights  where  classof x != targetobject  do

         x.on
= false
    )
    on TurnOnSelectedLight pressed  
do
(
        
for  x  in  selection  do

          
if  superclassof x == light then

             x.on
= true

          
else

             messagebox 
" 你选择的不是灯光 "  title: " 提示 "
    )
    on TurnOffSelectedLight pressed  
do
(
        
for  x  in  selection  do

          
if  superclassof x == light then

             x.on
= false

          
else

             messagebox 
" 你选择的不是灯光 "  title: " 提示 "
    )
    on ShowAllLight pressed  
do
        unhide lights
    on HideAllLight pressed  
do
        hide lights
    on HideSelectedLight pressed  
do
(
        
for  x  in  selection  do

          
if  superclassof x == light then

             hide x

          
else

             messagebox 
" 你选择的不是灯光 "  title: " 提示 "
    )
    on mu changed val 
do
(
    
        
for  x  in  selection  do  
            
if  superclassof x == light then
                x.multiplier
= mu.value     
            
    )
)
createdialog LightTool

转载于:https://www.cnblogs.com/jhcla/archive/2011/03/08/1977206.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值