Skip to content

Commit

Permalink
#80 Add pie menu to enable/disable gizmo
Browse files Browse the repository at this point in the history
  • Loading branch information
Weisl committed May 31, 2022
1 parent 8d705c4 commit 31126b8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
19 changes: 18 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
from . import addon_updater_ops
from . import pie_menu


import bpy

files = [
camera_controlls,
dolly_zoom_modal,
Expand All @@ -45,9 +48,19 @@
preferences
]


# def update_show_gizmo(self, context):
# scene = bpy.types.Scene
# # Set Gizmo to be visibile during the modal operation. Dirty!
# prefs = context.preferences.addons[__package__].preferences
# prefs.show_dolly_gizmo = scene.toggle_dolly_gizmo
#

def register():
# register variables saved in the blender scene
# scene = bpy.types.Scene
# scene.toggle_dolly_gizmo = bpy.props.BoolProperty(name='Dolly Zoom', description='Show the dolly gizmo', default=False, update=update_show_gizmo)


# addon updater code and configurations
# in case of broken version, try to register the updater first
# so that users can revert back to a working version
Expand All @@ -56,7 +69,11 @@ def register():
for file in files:
file.register()


def unregister():
# scene = bpy.types.Scene
# del scene.show_dolly_gizmo

for file in files.reverse():
file.unregister()

Expand Down
3 changes: 3 additions & 0 deletions pie_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def draw_center_column(self, context, col, cam_obj):
row = col.row(align=True)
row.operator("cam_manager.modal_camera_dolly_zoom", text="Dolly Zoom", icon='CON_CAMERASOLVER')

prefs = context.preferences.addons[__package__].preferences
row.prop(prefs,"show_dolly_gizmo", text="Gizmo")



def draw_right_column(self, context, col, cam_obj):
Expand Down
2 changes: 2 additions & 0 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ def draw(self, context):
text="", icon='IMAGE_BACKGROUND').camera_name = cam.name




class CameraCollectionProperty(bpy.types.PropertyGroup):
collection: bpy.props.PointerProperty(
name="Collection",
Expand Down

0 comments on commit 31126b8

Please sign in to comment.