Enable exporting the plan context by default

This commit is contained in:
Dion Moult
2020-09-09 23:21:24 +10:00
parent 38765c8f0e
commit 970832411c
2 changed files with 45 additions and 31 deletions
@@ -3679,6 +3679,8 @@ class SaveDrawingStyle(bpy.types.Operator):
'space.overlay.show_axis_y': space.overlay.show_axis_y,
'space.overlay.show_axis_z': space.overlay.show_axis_z,
'space.overlay.show_object_origins': space.overlay.show_object_origins,
'space.overlay.show_extras': space.overlay.show_extras,
'space.overlay.show_relationship_lines': space.overlay.show_relationship_lines,
}
if self.index:
index = int(self.index)
@@ -3734,6 +3736,9 @@ class ActivateDrawingStyle(bpy.types.Operator):
space.overlay.show_axis_y = style['space.overlay.show_axis_y']
space.overlay.show_axis_z = style['space.overlay.show_axis_z']
space.overlay.show_object_origins = style['space.overlay.show_object_origins']
space.overlay.show_extras = style['space.overlay.show_extras']
space.overlay.show_relationship_lines = style['space.overlay.show_relationship_lines']
space.shading.type = 'RENDERED'
def set_query(self):
self.selector = ifcopenshell.util.selector.Selector()
+40 -31
View File
@@ -63,11 +63,42 @@ def setDefaultProperties(scene):
subcontext = bpy.context.scene.BIMProperties.model_subcontexts.add()
subcontext.name = 'Box'
subcontext.target_view = 'MODEL_VIEW'
if bpy.context.scene.BIMProperties.has_plan_context \
and len(bpy.context.scene.BIMProperties.plan_subcontexts) == 0:
subcontext = bpy.context.scene.BIMProperties.plan_subcontexts.add()
subcontext.name = 'Annotation'
subcontext.target_view = 'PLAN_VIEW'
if len(bpy.context.scene.DocProperties.drawing_styles) == 0:
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
drawing_style.name = 'Blender Default'
drawing_style.render_type = 'DEFAULT'
bpy.ops.bim.save_drawing_style(index='0')
drawing_style.name = 'Technical'
drawing_style.render_type = 'VIEWPORT'
drawing_style.raster_style = json.dumps({
'bpy.data.worlds[0].color': (1, 1, 1),
'bpy.context.scene.render.engine': 'BLENDER_WORKBENCH',
'bpy.context.scene.render.film_transparent': False,
'bpy.context.scene.display.shading.show_object_outline': True,
'bpy.context.scene.display.shading.show_cavity': False,
'bpy.context.scene.display.shading.cavity_type': 'BOTH',
'bpy.context.scene.display.shading.curvature_ridge_factor': 1,
'bpy.context.scene.display.shading.curvature_valley_factor': 1,
'bpy.context.scene.view_settings.view_transform': 'Standard',
'bpy.context.scene.display.shading.light': 'FLAT',
'bpy.context.scene.display.shading.color_type': 'SINGLE',
'bpy.context.scene.display.shading.single_color': (1, 1, 1),
'bpy.context.scene.display.shading.show_shadows': False,
'bpy.context.scene.display.shading.shadow_intensity': 0.5,
'bpy.context.scene.display.light_direction': (.5, .5, .5),
'bpy.context.scene.view_settings.use_curve_mapping': False,
'space.overlay.show_wireframes': True,
'space.overlay.wireframe_threshold': 0,
'space.overlay.show_floor': False,
'space.overlay.show_axis_x': False,
'space.overlay.show_axis_y': False,
'space.overlay.show_axis_z': False,
'space.overlay.show_object_origins': False,
'space.overlay.show_extras': False,
'space.overlay.show_relationship_lines': False,
})
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
drawing_style.name = 'Shaded'
drawing_style.render_type = 'VIEWPORT'
@@ -95,35 +126,13 @@ def setDefaultProperties(scene):
'space.overlay.show_axis_y': False,
'space.overlay.show_axis_z': False,
'space.overlay.show_object_origins': False,
'space.overlay.show_extras': False,
'space.overlay.show_relationship_lines': False,
})
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
drawing_style.name = 'Technical'
drawing_style.render_type = 'VIEWPORT'
drawing_style.raster_style = json.dumps({
'bpy.data.worlds[0].color': (1, 1, 1),
'bpy.context.scene.render.engine': 'BLENDER_WORKBENCH',
'bpy.context.scene.render.film_transparent': False,
'bpy.context.scene.display.shading.show_object_outline': True,
'bpy.context.scene.display.shading.show_cavity': True,
'bpy.context.scene.display.shading.cavity_type': 'BOTH',
'bpy.context.scene.display.shading.curvature_ridge_factor': 1,
'bpy.context.scene.display.shading.curvature_valley_factor': 1,
'bpy.context.scene.view_settings.view_transform': 'Standard',
'bpy.context.scene.display.shading.light': 'FLAT',
'bpy.context.scene.display.shading.color_type': 'SINGLE',
'bpy.context.scene.display.shading.single_color': (1, 1, 1),
'bpy.context.scene.display.shading.show_shadows': False,
'bpy.context.scene.display.shading.shadow_intensity': 0.5,
'bpy.context.scene.display.light_direction': (.5, .5, .5),
'bpy.context.scene.view_settings.use_curve_mapping': False,
'space.overlay.show_wireframes': True,
'space.overlay.wireframe_threshold': 0,
'space.overlay.show_floor': False,
'space.overlay.show_axis_x': False,
'space.overlay.show_axis_y': False,
'space.overlay.show_axis_z': False,
'space.overlay.show_object_origins': False,
})
drawing_style.name = 'Blender Default'
drawing_style.render_type = 'DEFAULT'
bpy.ops.bim.save_drawing_style(index='2')
def getIfcPredefinedTypes(self, context):
@@ -1241,7 +1250,7 @@ class BIMProperties(PropertyGroup):
classification: EnumProperty(items=getClassifications, name="Classification", update=refreshReferences)
classifications: CollectionProperty(name="Classifications", type=Classification)
has_model_context: BoolProperty(name="Has Model Context", default=True)
has_plan_context: BoolProperty(name="Has Plan Context", default=False)
has_plan_context: BoolProperty(name="Has Plan Context", default=True)
model_subcontexts: CollectionProperty(name='Model Subcontexts', type=Subcontext)
plan_subcontexts: CollectionProperty(name='Plan Subcontexts', type=Subcontext)
available_contexts: EnumProperty(items=[('Model', 'Model', ''), ('Plan', 'Plan', '')], name="Available Contexts")