mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
small change on input from keyboard
This commit is contained in:
committed by
Bruno Perdigão
parent
67b01dcd0f
commit
5e2cefee12
@@ -514,21 +514,17 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
tool.Snaping.remove_last_polyline_point()
|
tool.Snaping.remove_last_polyline_point()
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
if event.value == 'PRESS' and event.type == 'I':
|
# if event.value == 'PRESS' and event.type == 'I':
|
||||||
|
# self.is_input_on = True
|
||||||
|
|
||||||
|
# if self.is_input_on:
|
||||||
|
if event.value == "PRESS" and event.type in self.input_options:
|
||||||
self.is_input_on = True
|
self.is_input_on = True
|
||||||
|
self.input_type = event.type
|
||||||
if self.is_input_on:
|
self.number_input = []
|
||||||
if event.value == 'PRESS' and event.type in self.input_options:
|
self.number_output = ""
|
||||||
self.input_type = event.type
|
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
self.number_input = []
|
tool.Blender.update_viewport()
|
||||||
self.number_output = ''
|
|
||||||
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
|
||||||
tool.Blender.update_viewport()
|
|
||||||
|
|
||||||
|
|
||||||
if event.value == 'PRESS' and event.type in {'RIGHTMOUSE', 'ESC'}:
|
|
||||||
self.is_input_on = False
|
|
||||||
self.input_type = None
|
|
||||||
|
|
||||||
if self.input_type:
|
if self.input_type:
|
||||||
if (event.ascii in self.number_options) or (event.value == "RELEASE" and event.type == "BACK_SPACE"):
|
if (event.ascii in self.number_options) or (event.value == "RELEASE" and event.type == "BACK_SPACE"):
|
||||||
@@ -567,18 +563,24 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:
|
if event.type in {"MIDDLEMOUSE", "WHEELUPMOUSE", "WHEELDOWNMOUSE"}:
|
||||||
return {'PASS_THROUGH'}
|
return {"PASS_THROUGH"}
|
||||||
|
|
||||||
if event.type in {'RIGHTMOUSE', 'ESC'}:
|
if self.is_input_on:
|
||||||
WallPolylineDecorator.uninstall()
|
if event.value == "PRESS" and event.type in {"RIGHTMOUSE", "ESC"}:
|
||||||
tool.Snaping.clear_polyline()
|
self.is_input_on = False
|
||||||
tool.Blender.update_viewport()
|
self.input_type = None
|
||||||
print("CANCELLED")
|
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
return {'CANCELLED'}
|
tool.Blender.update_viewport()
|
||||||
|
else:
|
||||||
return {'RUNNING_MODAL'}
|
if event.value == "PRESS" and event.type in {"RIGHTMOUSE", "ESC"}:
|
||||||
|
WallPolylineDecorator.uninstall()
|
||||||
|
tool.Snaping.clear_polyline()
|
||||||
|
tool.Blender.update_viewport()
|
||||||
|
print("CANCELLED")
|
||||||
|
return {"CANCELLED"}
|
||||||
|
|
||||||
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
if context.space_data.type == "VIEW_3D":
|
if context.space_data.type == "VIEW_3D":
|
||||||
|
|||||||
Reference in New Issue
Block a user