mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
CutDecorator color connected to preferences too #2987
This commit is contained in:
@@ -1908,6 +1908,9 @@ class CutDecorator:
|
|||||||
cls.installed = None
|
cls.installed = None
|
||||||
|
|
||||||
def __call__(self, context):
|
def __call__(self, context):
|
||||||
|
self.model_props = context.scene.BIMModelProperties
|
||||||
|
selected_elements_color = self.model_props.decorator_color_selected
|
||||||
|
|
||||||
all_vertices = []
|
all_vertices = []
|
||||||
all_edges = []
|
all_edges = []
|
||||||
selected_vertices = []
|
selected_vertices = []
|
||||||
@@ -1942,15 +1945,14 @@ class CutDecorator:
|
|||||||
self.shader = gpu.shader.from_builtin("3D_UNIFORM_COLOR")
|
self.shader = gpu.shader.from_builtin("3D_UNIFORM_COLOR")
|
||||||
self.shader.bind()
|
self.shader.bind()
|
||||||
|
|
||||||
green = (0.545, 0.863, 0, 1)
|
|
||||||
black = (0, 0, 0, 1)
|
black = (0, 0, 0, 1)
|
||||||
|
|
||||||
if all_vertices:
|
if all_vertices:
|
||||||
self.draw_batch("LINES", all_vertices, black, all_edges)
|
self.draw_batch("LINES", all_vertices, black, all_edges)
|
||||||
self.draw_batch("POINTS", all_vertices, black)
|
self.draw_batch("POINTS", all_vertices, black)
|
||||||
if selected_vertices:
|
if selected_vertices:
|
||||||
self.draw_batch("LINES", selected_vertices, green, selected_edges)
|
self.draw_batch("LINES", selected_vertices, selected_elements_color, selected_edges)
|
||||||
self.draw_batch("POINTS", selected_vertices, green)
|
self.draw_batch("POINTS", selected_vertices, selected_elements_color)
|
||||||
|
|
||||||
def draw_batch(self, shader_type, content_pos, color, indices=None):
|
def draw_batch(self, shader_type, content_pos, color, indices=None):
|
||||||
shader = self.line_shader if shader_type == "LINES" else self.shader
|
shader = self.line_shader if shader_type == "LINES" else self.shader
|
||||||
|
|||||||
Reference in New Issue
Block a user