achm_venetian_maker.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def draw(self, context):
        o = context.object
        # noinspection PyBroadException
        try:
            if 'VenetianObjectGenerator' not in o:
                return
        except:
            return

        layout = self.layout
        if bpy.context.mode == 'EDIT_MESH':
            layout.label('Warning: Operator does not work in edit mode.', icon='ERROR')
        else:
            myobjdat = o.VenetianObjectGenerator[0]
            space = bpy.context.space_data
            if not space.local_view:
                # Imperial units warning
                if bpy.context.scene.unit_settings.system == "IMPERIAL":
                    row = layout.row()
                    row.label("Warning: Imperial units not supported", icon='COLOR_RED')

            box = layout.box()
            row = box.row()
            row.prop(myobjdat, 'width')
            row.prop(myobjdat, 'height')
            row.prop(myobjdat, 'depth')
            row = box.row()
            row.prop(myobjdat, 'angle', slider=True)
            row.prop(myobjdat, 'ratio', slider=True)

            box = layout.box()
            if not context.scene.render.engine == 'CYCLES':
                box.enabled = False
            box.prop(myobjdat, 'crt_mat')
            if myobjdat.crt_mat:
                row = box.row()
                row.prop(myobjdat, 'objcol')
            else:
                row = layout.row()
                row.label("Warning: Operator does not work in local view mode", icon='ERROR')


# ------------------------------------------------------------------------------
# Create rectangular base
#
# x: size x axis
# y: size y axis
# z: size z axis
# ------------------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号