mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
snap: clear raycast global variables cache
This commit is contained in:
committed by
Bruno Perdigão
parent
3353afcbcd
commit
2e0a529c73
@@ -380,10 +380,7 @@ class PolylineOperator:
|
|||||||
if event.value == "RELEASE" and event.type in {"ESC"}:
|
if event.value == "RELEASE" and event.type in {"ESC"}:
|
||||||
self.tool_state.axis_method = None
|
self.tool_state.axis_method = None
|
||||||
self.tool_state.plane_method = None
|
self.tool_state.plane_method = None
|
||||||
context.workspace.status_text_set(text=None)
|
self.cleanup(context)
|
||||||
PolylineDecorator.uninstall()
|
|
||||||
tool.Polyline.clear_polyline()
|
|
||||||
tool.Blender.update_viewport()
|
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
def handle_mouse_move(
|
def handle_mouse_move(
|
||||||
@@ -424,6 +421,13 @@ class PolylineOperator:
|
|||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
|
def cleanup(self, context: bpy.Types.Context):
|
||||||
|
context.workspace.status_text_set(text=None)
|
||||||
|
PolylineDecorator.uninstall()
|
||||||
|
tool.Polyline.clear_polyline()
|
||||||
|
tool.Raycast.clear_cache()
|
||||||
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
def set_offset(self, context: bpy.types.Context, relating_type: ifcopenshell.entity_instance) -> None:
|
def set_offset(self, context: bpy.types.Context, relating_type: ifcopenshell.entity_instance) -> None:
|
||||||
props = tool.Model.get_model_props()
|
props = tool.Model.get_model_props()
|
||||||
direction_sense = props.direction_sense
|
direction_sense = props.direction_sense
|
||||||
|
|||||||
@@ -3264,13 +3264,10 @@ class MeasureTool(bpy.types.Operator, PolylineOperator):
|
|||||||
and event.value == "RELEASE"
|
and event.value == "RELEASE"
|
||||||
and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}
|
and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}
|
||||||
) or single_mode:
|
) or single_mode:
|
||||||
context.workspace.status_text_set(text=None)
|
|
||||||
self.tool_state.plane_method = None
|
self.tool_state.plane_method = None
|
||||||
PolylineDecorator.uninstall()
|
|
||||||
tool.Polyline.move_polyline_to_measure(context, self.input_ui)
|
tool.Polyline.move_polyline_to_measure(context, self.input_ui)
|
||||||
tool.Polyline.clear_polyline()
|
|
||||||
MeasureDecorator.install(context)
|
MeasureDecorator.install(context)
|
||||||
tool.Blender.update_viewport()
|
self.cleanup(context)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
self.handle_keyboard_input(context, event)
|
self.handle_keyboard_input(context, event)
|
||||||
|
|||||||
@@ -1070,6 +1070,17 @@ class Raycast(bonsai.core.tool.Raycast):
|
|||||||
def get_gpu_wireframe_snaps(cls, context, event, objs_to_raycast):
|
def get_gpu_wireframe_snaps(cls, context, event, objs_to_raycast):
|
||||||
return cls.get_gpu_detection_snaps(context, event, objs_to_raycast)
|
return cls.get_gpu_detection_snaps(context, event, objs_to_raycast)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def clear_cache(cls):
|
||||||
|
global _wireframe_batch_cache, _wireframe_vert_fmt, _triangle_batch_cache, _triangle_vert_fmt, _encoding_shader, _offscreen, _obj_list
|
||||||
|
_wireframe_batch_cache = {}
|
||||||
|
_wireframe_vert_fmt= None
|
||||||
|
_triangle_batch_cache= {}
|
||||||
|
_triangle_vert_fmt= None
|
||||||
|
_encoding_shader= None
|
||||||
|
_offscreen= None
|
||||||
|
_obj_list= []
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def ray_cast_by_proximity(
|
def ray_cast_by_proximity(
|
||||||
cls,
|
cls,
|
||||||
|
|||||||
Reference in New Issue
Block a user