Commit 02c6b921 authored by Dalai Felinto's avatar Dalai Felinto
Browse files

Toggle mode

parent 6106b8cd
......@@ -32,8 +32,9 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
description="",
items=(("ENABLE", "Enable", "Enable"),
("DISABLE", "Disable", "Disable"),
("TOGGLE", "Toggle", "Toggle"),
),
default="DISABLE",
default="TOGGLE",
options={'SKIP_SAVE'},
)
......@@ -70,6 +71,9 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
is_enabled = vr.is_enabled
if self.action == 'TOGGLE':
self.action = 'DISABLE' if is_enabled else 'ENABLE'
if self.action == 'DISABLE':
if vr.is_enabled:
self.quit(context)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment