mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
Minor fix
This commit is contained in:
@@ -50,16 +50,17 @@ def depsgraph_update_pre_handler(scene):
|
|||||||
|
|
||||||
def set_active_camera_resolution(scene):
|
def set_active_camera_resolution(scene):
|
||||||
if not scene.camera \
|
if not scene.camera \
|
||||||
or '/' not in scene.camera.name:
|
or '/' not in scene.camera.name \
|
||||||
|
or not scene.DocProperties.drawings:
|
||||||
return
|
return
|
||||||
if scene.render.resolution_x != scene.camera.data.BIMCameraProperties.raster_x \
|
if scene.render.resolution_x != scene.camera.data.BIMCameraProperties.raster_x \
|
||||||
or scene.render.resolution_y != scene.camera.data.BIMCameraProperties.raster_y:
|
or scene.render.resolution_y != scene.camera.data.BIMCameraProperties.raster_y:
|
||||||
scene.render.resolution_x = scene.camera.data.BIMCameraProperties.raster_x
|
scene.render.resolution_x = scene.camera.data.BIMCameraProperties.raster_x
|
||||||
scene.render.resolution_y = scene.camera.data.BIMCameraProperties.raster_y
|
scene.render.resolution_y = scene.camera.data.BIMCameraProperties.raster_y
|
||||||
active_drawing = scene.DocProperties.drawings[scene.DocProperties.active_drawing_index]
|
current_drawing = scene.DocProperties.drawings[scene.DocProperties.current_drawing_index]
|
||||||
if active_drawing.camera != scene.camera:
|
if scene.camera != current_drawing.camera:
|
||||||
scene.DocProperties.active_drawing_index = scene.DocProperties.drawings.find(scene.camera.name.split('/')[1])
|
scene.DocProperties.current_drawing_index = scene.DocProperties.drawings.find(scene.camera.name.split('/')[1])
|
||||||
bpy.ops.bim.activate_view()
|
bpy.ops.bim.activate_view(drawing_index=scene.DocProperties.current_drawing_index)
|
||||||
|
|
||||||
|
|
||||||
class ExportIFC(bpy.types.Operator):
|
class ExportIFC(bpy.types.Operator):
|
||||||
@@ -2324,9 +2325,10 @@ class CreateSheets(bpy.types.Operator):
|
|||||||
class ActivateView(bpy.types.Operator):
|
class ActivateView(bpy.types.Operator):
|
||||||
bl_idname = 'bim.activate_view'
|
bl_idname = 'bim.activate_view'
|
||||||
bl_label = 'Activate View'
|
bl_label = 'Activate View'
|
||||||
|
drawing_index: bpy.props.IntProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
camera = bpy.context.scene.DocProperties.drawings[bpy.context.scene.DocProperties.active_drawing_index].camera
|
camera = bpy.context.scene.DocProperties.drawings[self.drawing_index].camera
|
||||||
if not camera:
|
if not camera:
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
bpy.context.scene.camera = camera
|
bpy.context.scene.camera = camera
|
||||||
@@ -3669,7 +3671,7 @@ class ActivateDrawingStyle(bpy.types.Operator):
|
|||||||
bl_label = 'Activate Drawing Style'
|
bl_label = 'Activate Drawing Style'
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
self.drawing_style = bpy.context.scene.DocProperties.drawing_styles[bpy.context.active_object.data.BIMCameraProperties.active_drawing_style_index]
|
self.drawing_style = bpy.context.scene.DocProperties.drawing_styles[context.scene.camera.data.BIMCameraProperties.active_drawing_style_index]
|
||||||
self.set_raster_style()
|
self.set_raster_style()
|
||||||
self.set_query()
|
self.set_query()
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|||||||
@@ -537,6 +537,7 @@ class DocProperties(PropertyGroup):
|
|||||||
should_extract: BoolProperty(name="Should Extract", default=True)
|
should_extract: BoolProperty(name="Should Extract", default=True)
|
||||||
drawings: CollectionProperty(name='Drawings', type=Drawing)
|
drawings: CollectionProperty(name='Drawings', type=Drawing)
|
||||||
active_drawing_index: IntProperty(name='Active Drawing Index')
|
active_drawing_index: IntProperty(name='Active Drawing Index')
|
||||||
|
current_drawing_index: IntProperty(name='Current Drawing Index')
|
||||||
schedules: CollectionProperty(name='Schedules', type=Schedule)
|
schedules: CollectionProperty(name='Schedules', type=Schedule)
|
||||||
active_schedule_index: IntProperty(name='Active Schedule Index')
|
active_schedule_index: IntProperty(name='Active Schedule Index')
|
||||||
titleblock: EnumProperty(items=getTitleblocks, name="Titleblock", update=refreshTitleblocks)
|
titleblock: EnumProperty(items=getTitleblocks, name="Titleblock", update=refreshTitleblocks)
|
||||||
|
|||||||
@@ -740,7 +740,8 @@ class BIM_PT_drawings(Panel):
|
|||||||
if props.drawings:
|
if props.drawings:
|
||||||
op = row.operator('bim.open_view', icon='URL', text='')
|
op = row.operator('bim.open_view', icon='URL', text='')
|
||||||
op.view = props.drawings[props.active_drawing_index].name
|
op.view = props.drawings[props.active_drawing_index].name
|
||||||
row.operator('bim.activate_view', icon='SCENE', text='')
|
op = row.operator('bim.activate_view', icon='SCENE', text='')
|
||||||
|
op.drawing_index = props.active_drawing_index
|
||||||
row.operator('bim.remove_drawing', icon='X', text='').index = props.active_drawing_index
|
row.operator('bim.remove_drawing', icon='X', text='').index = props.active_drawing_index
|
||||||
|
|
||||||
layout.template_list('BIM_UL_generic', '', props, 'drawings', props, 'active_drawing_index')
|
layout.template_list('BIM_UL_generic', '', props, 'drawings', props, 'active_drawing_index')
|
||||||
|
|||||||
Reference in New Issue
Block a user