achm_roof_maker.py 文件源码

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

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def draw(self, context):
        layout = self.layout
        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()
            box.prop(self, 'model')
            box.prop(self, 'roof_width')
            box.prop(self, 'roof_height')
            box.prop(self, 'roof_scale')

            tilesize_x = 0
            tilesize_y = 0
            if self.model == "1":
                tilesize_x = 0.184
                tilesize_y = 0.413

            if self.model == "2":
                tilesize_x = 0.103
                tilesize_y = 0.413

            if self.model == "3":
                tilesize_x = 0.184
                tilesize_y = 0.434

            if self.model == "4":
                tilesize_x = 0.231
                tilesize_y = 0.39

            x = tilesize_x * self.roof_scale * self.roof_width
            y = tilesize_y * self.roof_scale * self.roof_height

            buf = 'Size: {0:.2f} * {1:.2f} aprox.'.format(x, y)
            box.label(buf)

            box = layout.box()
            box.prop(self, 'roof_thick')
            box.prop(self, 'roof_angle')

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

    # -----------------------------------------------------
    # Execute
    # -----------------------------------------------------
    # noinspection PyUnusedLocal
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号