mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Added button to conveniently edit the vector style CSS within Blender
This commit is contained in:
@@ -183,6 +183,7 @@ if bpy is not None:
|
||||
operator.RemoveDrawingStyle,
|
||||
operator.SaveDrawingStyle,
|
||||
operator.ActivateDrawingStyle,
|
||||
operator.EditVectorStyle,
|
||||
prop.StrProperty,
|
||||
prop.Variable,
|
||||
prop.Role,
|
||||
|
||||
@@ -3499,3 +3499,15 @@ class RemoveDrawing(bpy.types.Operator):
|
||||
bpy.data.collections.remove(collection, do_unlink=True)
|
||||
props.drawings.remove(self.index)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class EditVectorStyle(bpy.types.Operator):
|
||||
bl_idname = 'bim.edit_vector_style'
|
||||
bl_label = 'Edit Vector Style'
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
camera = context.scene.camera
|
||||
vector_style = context.scene.DocProperties.drawing_styles[camera.data.BIMCameraProperties.active_drawing_style_index].vector_style
|
||||
bpy.data.texts.load(os.path.join(context.scene.BIMProperties.data_dir, 'styles', vector_style + '.css'))
|
||||
return {'FINISHED'}
|
||||
|
||||
@@ -899,6 +899,7 @@ class BIM_PT_camera(Panel):
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(drawing_style, 'vector_style')
|
||||
row.operator('bim.edit_vector_style', text='', icon='GREASEPENCIL')
|
||||
row = layout.row(align=True)
|
||||
row.prop(drawing_style, 'include_query')
|
||||
row = layout.row(align=True)
|
||||
|
||||
Reference in New Issue
Block a user