Live patch: ignore more operators & fix code style
This commit is contained in:
parent
ee194a1806
commit
823cc379b6
|
@ -224,17 +224,29 @@ def on_operator(operator_id: str):
|
||||||
"""
|
"""
|
||||||
if not __running:
|
if not __running:
|
||||||
return
|
return
|
||||||
# Don't re-export the scene for the following operators
|
|
||||||
if operator_id in ("VIEW3D_OT_select", "OUTLINER_OT_item_activate", "OBJECT_OT_editmode_toggle", "NODE_OT_select", "NODE_OT_translate_attach_remove_on_cancel"):
|
if operator_id in IGNORE_OPERATORS:
|
||||||
return
|
return
|
||||||
|
|
||||||
if operator_id == "TRANSFORM_OT_translate":
|
if operator_id == 'TRANSFORM_OT_translate':
|
||||||
send_event("obj_location")
|
send_event('obj_location')
|
||||||
elif operator_id in ("TRANSFORM_OT_rotate", "TRANSFORM_OT_trackball"):
|
elif operator_id in ('TRANSFORM_OT_rotate', 'TRANSFORM_OT_trackball'):
|
||||||
send_event("obj_rotation")
|
send_event('obj_rotation')
|
||||||
elif operator_id == "TRANSFORM_OT_resize":
|
elif operator_id == 'TRANSFORM_OT_resize':
|
||||||
send_event("obj_scale")
|
send_event('obj_scale')
|
||||||
|
|
||||||
# Rebuild
|
# Rebuild
|
||||||
else:
|
else:
|
||||||
patch_export()
|
patch_export()
|
||||||
|
|
||||||
|
|
||||||
|
# Don't re-export the scene for the following operators
|
||||||
|
IGNORE_OPERATORS = (
|
||||||
|
'VIEW3D_OT_select',
|
||||||
|
'VIEW3D_OT_select_box',
|
||||||
|
'OUTLINER_OT_item_activate',
|
||||||
|
'OBJECT_OT_editmode_toggle',
|
||||||
|
'NODE_OT_select',
|
||||||
|
'NODE_OT_translate_attach_remove_on_cancel',
|
||||||
|
'NODE_OT_translate_attach'
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue