[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4766] contrib/py/scripts/addons/ scene_amaranth_toolset.py: Productivity toolset addon that I' ve been working on for some months and got good feedback from artists.
Pablo Vazquez
venomgfx at gmail.com
Sat Sep 21 10:40:31 CEST 2013
Revision: 4766
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4766
Author: venomgfx
Date: 2013-09-21 08:40:31 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
Productivity toolset addon that I've been working on for some months and got good feedback from artists.
More info at http://pablovazquez.org/amaranth
Added Paths:
-----------
contrib/py/scripts/addons/scene_amaranth_toolset.py
Added: contrib/py/scripts/addons/scene_amaranth_toolset.py
===================================================================
--- contrib/py/scripts/addons/scene_amaranth_toolset.py (rev 0)
+++ contrib/py/scripts/addons/scene_amaranth_toolset.py 2013-09-21 08:40:31 UTC (rev 4766)
@@ -0,0 +1,924 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+bl_info = {
+ "name": "Amaranth Toolset",
+ "author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin",
+ "version": (0, 6),
+ "blender": (2, 68),
+ "location": "Scene Properties > Amaranth Toolset Panel",
+ "description": "A collection of tools and settings to improve productivity",
+ "warning": "",
+ "wiki_url": "http://pablovazquez.org/amaranth",
+ "tracker_url": "",
+ "category": "Scene"}
+
+
+import bpy
+from bpy.types import Operator, AddonPreferences
+from bpy.props import BoolProperty
+from mathutils import Vector
+from bpy.app.handlers import persistent
+
+# Preferences
+class AmaranthToolsetPreferences(AddonPreferences):
+ bl_idname = __name__
+ use_frame_current = BoolProperty(
+ name="Current Frame Slider",
+ description="Set the current frame from the Specials menu in the 3D View",
+ default=True,
+ )
+ use_file_save_reload = BoolProperty(
+ name="Save & Reload File",
+ description="File menu > Save & Reload, or Ctrl + Shift + W",
+ default=True,
+ )
+
+ use_scene_refresh = BoolProperty(
+ name="Refresh Scene",
+ description="Specials Menu [W], or hit F5",
+ default=True,
+ )
+ use_timeline_extra_info = BoolProperty(
+ name="Timeline Extra Info",
+ description="Timeline Header",
+ default=True,
+ )
+ use_image_node_display = BoolProperty(
+ name="Active Image Node in Editor",
+ description="Display active node image in image editor",
+ default=True,
+ )
+ use_scene_stats = BoolProperty(
+ name="Extra Scene Statistics",
+ description="Display extra scene statistics in Info editor's header",
+ default=True,
+ )
+
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.label(
+ text="Here you can enable or disable specific tools, "
+ "in case they interfere with others or are just plain annoying")
+
+ split = layout.split(percentage=0.25)
+
+ col = split.column()
+ sub = col.column(align=True)
+ sub.label(text="3D View", icon="VIEW3D")
+ sub.prop(self, "use_frame_current")
+ sub.prop(self, "use_scene_refresh")
+
+ sub.separator()
+
+ sub.label(text="General", icon="SCENE_DATA")
+ sub.prop(self, "use_file_save_reload")
+ sub.prop(self, "use_timeline_extra_info")
+ sub.prop(self, "use_scene_stats")
+
+ sub.separator()
+
+ sub.label(text="Nodes Editor", icon="NODETREE")
+ sub.prop(self, "use_image_node_display")
+
+ col = split.column()
+ sub = col.column(align=True)
+ sub.label(text="")
+ sub.label(
+ text="Set the current frame from the Specials menu in the 3D View [W]")
+ sub.label(
+ text="Refresh the current Scene. Hotkey: F5 or in Specials menu [W]")
+
+ sub.separator()
+ sub.label(text="") # General
+ sub.label(
+ text="Quickly save and reload the current file (no warning!). "
+ "File menu or Ctrl+Shift+W")
+ sub.label(
+ text="SMPTE Timecode and frames left/ahead on Timeline's header")
+ sub.label(
+ text="Display extra statistics for Scenes, Cameras, and Meshlights (Cycles)")
+
+ sub.separator()
+ sub.label(text="") # Nodes
+ sub.label(
+ text="When selecting an Image node, display it on the Image editor "
+ "(if any)")
+
+# Properties
+def init_properties():
+
+ scene = bpy.types.Scene
+ node = bpy.types.Node
+ nodes_compo = bpy.types.CompositorNodeTree
+
+ scene.use_unsimplify_render = bpy.props.BoolProperty(
+ default=False,
+ name="Unsimplify Render",
+ description="Disable Simplify during render")
+ scene.simplify_status = bpy.props.BoolProperty(default=False)
+
+ node.use_matching_indices = bpy.props.BoolProperty(
+ default=True,
+ description="If disabled, display all available indices")
+
+ test_items = [
+ ("ALL", "All Types", "", 0),
+ ("BLUR", "Blur", "", 1),
+ ("BOKEHBLUR", "Bokeh Blur", "", 2),
+ ("VECBLUR", "Vector Blur", "", 3),
+ ("DEFOCUS", "Defocus", "", 4),
+ ("R_LAYERS", "Render Layer", "", 5)
+ ]
+
+ nodes_compo.types = bpy.props.EnumProperty(
+ items=test_items, name = "Types")
+
+ nodes_compo.toggle_mute = bpy.props.BoolProperty(default=False)
+ node.status = bpy.props.BoolProperty(default=False)
+
+
+def clear_properties():
+ props = (
+ "use_unsimplify_render",
+ "simplify_status",
+ "use_matching_indices",
+ "use_simplify_nodes_vector",
+ "status"
+ )
+
+ wm = bpy.context.window_manager
+ for p in props:
+ if p in wm:
+ del wm[p]
+
+# FEATURE: Refresh Scene!
+class SCENE_OT_refresh(Operator):
+ """Refresh the current scene"""
+ bl_idname = "scene.refresh"
+ bl_label = "Refresh!"
+
+ def execute(self, context):
+ preferences = context.user_preferences.addons[__name__].preferences
+ scene = context.scene
+
+ if preferences.use_scene_refresh:
+ # Changing the frame is usually the best way to go
+ scene.frame_current = scene.frame_current
+ self.report({"INFO"}, "Scene Refreshed!")
+
+ return {'FINISHED'}
+
+def button_refresh(self, context):
+
+ preferences = context.user_preferences.addons[__name__].preferences
+
+ if preferences.use_scene_refresh:
+ self.layout.separator()
+ self.layout.operator(
+ SCENE_OT_refresh.bl_idname,
+ text="Refresh!",
+ icon='FILE_REFRESH')
+# // FEATURE: Refresh Scene!
+
+# FEATURE: Save & Reload
+def save_reload(self, context, path):
+
+ if path:
+ bpy.ops.wm.save_mainfile()
+ self.report({'INFO'}, "Saved & Reloaded")
+ bpy.ops.wm.open_mainfile("EXEC_DEFAULT", filepath=path)
+ else:
+ bpy.ops.wm.save_as_mainfile("INVOKE_AREA")
+
+class WM_OT_save_reload(Operator):
+ """Save and Reload the current blend file"""
+ bl_idname = "wm.save_reload"
+ bl_label = "Save & Reload"
+
+ def execute(self, context):
+
+ path = bpy.data.filepath
+ save_reload(self, context, path)
+ return {'FINISHED'}
+
+def button_save_reload(self, context):
+
+ preferences = context.user_preferences.addons[__name__].preferences
+
+ if preferences.use_file_save_reload:
+ self.layout.separator()
+ self.layout.operator(
+ WM_OT_save_reload.bl_idname,
+ text="Save & Reload",
+ icon='FILE_REFRESH')
+# // FEATURE: Save & Reload
+
+# FEATURE: Current Frame
+def button_frame_current(self, context):
+
+ preferences = context.user_preferences.addons[__name__].preferences
+ scene = context.scene
+
+ if preferences.use_frame_current:
+ self.layout.separator()
+ self.layout.prop(
+ scene, "frame_current",
+ text="Set Current Frame")
+# // FEATURE: Current Frame
+
+# FEATURE: Timeline Time + Frames Left
+def label_timeline_extra_info(self, context):
+
+ preferences = context.user_preferences.addons[__name__].preferences
+ layout = self.layout
+ scene = context.scene
+
+ if preferences.use_timeline_extra_info:
+ row = layout.row(align=True)
+
+ # Check for preview range
+ frame_start = scene.frame_preview_start if scene.use_preview_range else scene.frame_start
+ frame_end = scene.frame_preview_end if scene.use_preview_range else scene.frame_end
+
+ row.label(text="%s / %s" % (bpy.utils.smpte_from_frame(scene.frame_current - frame_start),
+ bpy.utils.smpte_from_frame(frame_end - frame_start)))
+
+ if (scene.frame_current > frame_end):
+ row.label(text="%s Frames Ahead" % ((frame_end - scene.frame_current) * -1))
+ elif (scene.frame_current == frame_start):
+ row.label(text="%s Start Frame" % scene.frame_current)
+ elif (scene.frame_current == frame_end):
+ row.label(text="%s End Frame" % scene.frame_current)
+ else:
+ row.label(text="%s Frames Left" % (frame_end - scene.frame_current))
+
+# // FEATURE: Timeline Time + Frames Left
+
+# FEATURE: Directory Current Blend
+class FILE_OT_directory_current_blend(Operator):
+ """Go to the directory of the currently open blend file"""
+ bl_idname = "file.directory_current_blend"
+ bl_label = "Current Blend's Folder"
+
+ def execute(self, context):
+ bpy.ops.file.select_bookmark(dir='//')
+ return {'FINISHED'}
+
+def button_directory_current_blend(self, context):
+
+ if bpy.data.filepath:
+ self.layout.operator(
+ FILE_OT_directory_current_blend.bl_idname,
+ text="Current Blend's Folder",
+ icon='APPEND_BLEND')
+# // FEATURE: Directory Current Blend
+
+# FEATURE: Node Templates
+class NODE_OT_AddTemplateVignette(Operator):
+ bl_idname = "node.template_add_vignette"
+ bl_label = "Add Vignette"
+ bl_description = "Add a vignette effect"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ @classmethod
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list