New operator to quickly set diagram render options

This commit is contained in:
Dion Moult
2020-02-01 22:49:35 +11:00
parent 9571d4a67b
commit 691cc8759a
3 changed files with 20 additions and 0 deletions
@@ -1134,3 +1134,19 @@ class AssignContext(bpy.types.Operator):
name[0:6] == 'Model/' \
or name[0:5] == 'Plan/' \
)
class SetViewPreset1(bpy.types.Operator):
bl_idname = 'bim.set_view_preset_1'
bl_label = 'Set View Preset 1'
def execute(self, context):
bpy.data.worlds[0].color = (1, 1, 1)
bpy.context.scene.render.engine = 'BLENDER_WORKBENCH'
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'
return {'FINISHED'}