Skip to content

Commit

Permalink
0_7_5
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiKrafting committed Oct 8, 2017
1 parent 96f3d49 commit 8ad3cbe
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 38 deletions.
101 changes: 82 additions & 19 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"name": "Pipeline",
"description": "3D Pipeline Tools",
"author": "Digiography.Studio",
"version": (0, 7, 0),
"version": (0, 7, 5),
"blender": (2, 79, 0),
"location": "Properties > Scene, Info Toolbar, 3D View Toolbar",
"wiki_url": "https://github.com/Digiography/blender_addon_pipeline/wiki",
Expand Down Expand Up @@ -164,6 +164,14 @@ class ds_pipeline_addon_prefs(bpy.types.AddonPreferences):
name="Show Daz3D Button",
default=True,
)
option_show_open = bpy.props.BoolProperty(
name="Open Button",
default=True,
)
option_show_new = bpy.props.BoolProperty(
name="New Button",
default=True,
)
option_show_save = bpy.props.BoolProperty(
name="Save Button",
default=True,
Expand Down Expand Up @@ -224,15 +232,15 @@ class ds_pipeline_addon_prefs(bpy.types.AddonPreferences):
name="Menu Toggle",
default=True,
)
option_show_menu_toggle_btn = bpy.props.BoolProperty(
option_show_menu_toggle_state = bpy.props.BoolProperty(
name="Menu Toggle Button State",
default=False,
)
option_show_screens_toggle = bpy.props.BoolProperty(
name="Screens Toggle",
default=True,
)
option_show_screens_toggle_btn = bpy.props.BoolProperty(
option_show_screens_toggle_state = bpy.props.BoolProperty(
name="Screens Toggle Button State",
default=False,
)
Expand All @@ -248,7 +256,14 @@ class ds_pipeline_addon_prefs(bpy.types.AddonPreferences):
name="Stats",
default=False,
)

option_show_iclone_toggle = bpy.props.BoolProperty(
name="iClone Toggle",
default=True,
)
option_show_iclone_toggle_state = bpy.props.BoolProperty(
name="iClone Toggle Button State",
default=False,
)
def draw(self, context):

layout = self.layout
Expand Down Expand Up @@ -279,6 +294,9 @@ def draw(self, context):
box.label('Show',icon='UI')
box.prop(self, 'option_show_menu_toggle')
box.prop(self, 'option_show_screens_toggle')
box.prop(self, 'option_show_iclone_toggle')
box.prop(self, 'option_show_new')
box.prop(self, 'option_show_open')
box.prop(self, 'option_show_save')
box.prop(self, 'option_show_save_as')
box.prop(self, 'option_show_fullscreen')
Expand Down Expand Up @@ -345,10 +363,10 @@ class ds_pipeline_menu_toggle(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):

if not bpy.context.user_preferences.addons[__package__].preferences.option_show_menu_toggle_btn:
bpy.context.user_preferences.addons[__package__].preferences.option_show_menu_toggle_btn=True
if not bpy.context.user_preferences.addons[__package__].preferences.option_show_menu_toggle_state:
bpy.context.user_preferences.addons[__package__].preferences.option_show_menu_toggle_state=True
else:
bpy.context.user_preferences.addons[__package__].preferences.option_show_menu_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_menu_toggle_state=False
return {'FINISHED'}

class ds_pipeline_screens_toggle(bpy.types.Operator):
Expand All @@ -358,10 +376,23 @@ class ds_pipeline_screens_toggle(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):

if not bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn:
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=True
if not bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state:
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=True
else:
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}

class ds_pipeline_iclone_toggle(bpy.types.Operator):
bl_idname = "ds_pipeline.iclone_toggle"
bl_label = "iClone"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
def execute(self, context):

if not bpy.context.user_preferences.addons[__package__].preferences.option_show_iclone_toggle_state:
bpy.context.user_preferences.addons[__package__].preferences.option_show_iclone_toggle_state=True
else:
bpy.context.user_preferences.addons[__package__].preferences.option_show_iclone_toggle_state=False
return {'FINISHED'}

class ds_pipeline_quit(bpy.types.Operator):
Expand Down Expand Up @@ -393,7 +424,7 @@ class ds_pipeline_screen_3dview(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['3D View Full']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_anim(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_anim"
Expand All @@ -402,7 +433,7 @@ class ds_pipeline_screen_anim(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Animation']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_compositing(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_compositing"
Expand All @@ -411,7 +442,7 @@ class ds_pipeline_screen_compositing(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Compositing']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_default(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_default"
Expand All @@ -420,7 +451,7 @@ class ds_pipeline_screen_default(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Default']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_game(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_game"
Expand All @@ -429,7 +460,7 @@ class ds_pipeline_screen_game(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Game Logic']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_motion(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_motion"
Expand All @@ -438,7 +469,7 @@ class ds_pipeline_screen_motion(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Motion Tracking']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_scripting(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_scripting"
Expand All @@ -447,7 +478,7 @@ class ds_pipeline_screen_scripting(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Scripting']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_uv(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_uv"
Expand All @@ -456,7 +487,7 @@ class ds_pipeline_screen_uv(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['UV Editing']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}
class ds_pipeline_screen_video(bpy.types.Operator):
bl_idname = "ds_pipeline.screen_video"
Expand All @@ -465,7 +496,7 @@ class ds_pipeline_screen_video(bpy.types.Operator):
bl_region_type = 'WINDOW'
def execute(self, context):
bpy.context.window.screen = bpy.data.screens['Video Editing']
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_btn=False
bpy.context.user_preferences.addons[__package__].preferences.option_show_screens_toggle_state=False
return {'FINISHED'}

class ds_pipeline_prefs_open(bpy.types.Operator):
Expand All @@ -481,6 +512,32 @@ def execute(self, context):

return {'FINISHED'}

class ds_new(bpy.types.Operator):

bl_idname = "ds.new"
bl_label = "New"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

def execute(self, context):

bpy.ops.wm.read_homefile()

return {'FINISHED'}

class ds_open(bpy.types.Operator):

bl_idname = "ds.open"
bl_label = "Open"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

def execute(self, context):

bpy.ops.wm.open_mainfile()

return {'FINISHED'}

class ds_save(bpy.types.Operator):

bl_idname = "ds.save"
Expand Down Expand Up @@ -513,7 +570,10 @@ def register():

register_class(ds_pipeline_menu_toggle)
register_class(ds_pipeline_screens_toggle)
register_class(ds_pipeline_iclone_toggle)

register_class(ds_new)
register_class(ds_open)
register_class(ds_save)
register_class(ds_save_as)
register_class(ds_pipeline_addon_prefs)
Expand Down Expand Up @@ -563,7 +623,10 @@ def unregister():

unregister_class(ds_pipeline_menu_toggle)
unregister_class(ds_pipeline_screens_toggle)
unregister_class(ds_pipeline_iclone_toggle)

unregister_class(ds_new)
unregister_class(ds_open)
unregister_class(ds_save)
unregister_class(ds_save_as)
unregister_class(ds_pipeline_addon_prefs)
Expand Down
Loading

0 comments on commit 8ad3cbe

Please sign in to comment.