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
评论列表
文章目录