码迷,mamicode.com
首页 > 其他好文 > 详细

吸取属性

时间:2019-12-28 00:01:20      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:div   button   class   rop   mes   style   btn   修改   out   

--------------------
global copy_wir_col = true        -- 吸取线框颜色
global copy_mat = true            -- 吸取材质
global copy_name = true        -- 吸取名字
global copy_modify = true        -- 吸取修改器
global copy_layer = true        -- 吸取图层
--------------------
fn FN_copyset =        --吸取属性设置函数
(
    try (destroydialog copyset_Roll)catch()
    rollout copyset_Roll "关联属性设置" width:110 height:150
    (
        checkbox chk_wirecolor "关联颜色" pos:[20,9] width:70 height:20
        checkbox chk_material "关联材质" pos:[20,30] width:70 height:20
        checkbox chk_name "统一名字" pos:[20,51] width:70 height:20
        checkbox chk_modify "关联修改器" pos:[20,72] width:80 height:20
        checkbox chk_layer "统一图层" pos:[20,93] width:70 height:20 
        button btn_ok "确定" pos:[20,120] width:70 height:25
        
        on copyset_Roll open do
        (
            chk_material.state = copy_mat
            chk_wirecolor.state = copy_wir_col
            chk_name.state = copy_name
            chk_modify.state = copy_modify
            chk_layer.state = copy_layer
        )
        on chk_material changed state do
            copy_mat = state
        on chk_wirecolor changed state do
            copy_wir_col = state
        on chk_name changed state do
            copy_name = state
        on chk_modify changed state do
            copy_modify = state
        on chk_layer changed state do
            copy_layer = state
        on btn_ok pressed do
            destroydialog copyset_roll
    )
    createdialog copyset_Roll style:#(#style_toolwindow, #style_sysmenu)
)
fn FN_copypro =        --吸取属性
(
    obj_pick=pickObject()
    if (selection.count != 0) and (obj_pick != undefined) then
    (
        if copy_wir_col then ($.wirecolor = obj_pick.wirecolor)        -- 线框颜色
        if copy_mat then ($.material = obj_pick.material)        -- 材质
        if copy_name then        -- 统一名字
        (
            for m = 1 to selection.count do (selection[m].name = uniqueName obj_pick.name)
        )
        if copy_modify then    -- 吸取所有修改器 
        (
            if obj_pick.modifiers != 0 then
            (
                for m = 1 to selection.count do 
                (
                    
                    for u = obj_pick.modifiers.count  to 1 by -1 do  try( addModifier selection[m]  obj_pick.modifiers[u])catch()
                )
            )
        )
        if copy_layer then     -- 吸取图层
        (
            vLayer =obj_pick.INodeLayerProperties.layer
            for e in selection do vLayer.addNode e
        )
    )
    else(messagebox "请先选择物体!")
)

吸取属性

标签:div   button   class   rop   mes   style   btn   修改   out   

原文地址:https://www.cnblogs.com/humd/p/12110024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!