[Bf-extensions-cvs] [02bd0ef] master: Amaranth Addon

Pablo Vazquez noreply at git.blender.org
Fri Feb 27 17:56:34 CET 2015


Commit: 02bd0ef30e579573f94c37d36168a7134d832f75
Author: Pablo Vazquez
Date:   Fri Feb 27 17:53:54 2015 +0100
Branches: master
https://developer.blender.org/rBAC02bd0ef30e579573f94c37d36168a7134d832f75

Amaranth Addon

Upgrade to 1.0, includes the refactor by Cesar Saez (thanks!), and a bunch of new features.

Documentation is being updated here:
http://pablovazquez.org/amaranth/

Full changelog:
https://github.com/venomgfx/amaranth/commits/master

===================================================================

A	amaranth/__init__.py
A	amaranth/animation/__init__.py
A	amaranth/animation/frame_current.py
A	amaranth/animation/jump_frames.py
A	amaranth/animation/motion_paths.py
A	amaranth/animation/timeline_extra_info.py
A	amaranth/misc/__init__.py
A	amaranth/misc/color_management.py
A	amaranth/misc/dopesheet_grapheditor.py
A	amaranth/misc/dupli_group_id.py
A	amaranth/misc/sequencer_extra_info.py
A	amaranth/misc/toggle_wire.py
A	amaranth/modeling/__init__.py
A	amaranth/modeling/symmetry_tools.py
A	amaranth/node_editor/__init__.py
A	amaranth/node_editor/display_image.py
A	amaranth/node_editor/id_panel.py
A	amaranth/node_editor/node_shader_extra.py
A	amaranth/node_editor/node_stats.py
A	amaranth/node_editor/normal_node.py
A	amaranth/node_editor/simplify_nodes.py
A	amaranth/node_editor/switch_material.py
A	amaranth/node_editor/templates/__init__.py
A	amaranth/node_editor/templates/vectorblur.py
A	amaranth/node_editor/templates/vignette.py
A	amaranth/prefs.py
A	amaranth/render/__init__.py
A	amaranth/render/border_camera.py
A	amaranth/render/final_resolution.py
A	amaranth/render/meshlight_add.py
A	amaranth/render/meshlight_select.py
A	amaranth/render/only_render.py
A	amaranth/render/passepartout.py
A	amaranth/render/remember_layers.py
A	amaranth/render/render_output_z.py
A	amaranth/render/samples_scene.py
A	amaranth/render/unsimplify.py
A	amaranth/scene/__init__.py
A	amaranth/scene/current_blend.py
A	amaranth/scene/debug.py
A	amaranth/scene/goto_library.py
A	amaranth/scene/material_remove_unassigned.py
A	amaranth/scene/refresh.py
A	amaranth/scene/save_reload.py
A	amaranth/scene/stats.py
A	amaranth/utils.py
D	scene_amaranth_toolset.py

===================================================================

diff --git a/amaranth/__init__.py b/amaranth/__init__.py
new file mode 100644
index 0000000..d8ebf4a
--- /dev/null
+++ b/amaranth/__init__.py
@@ -0,0 +1,123 @@
+#  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.
+"""
+Amaranth
+
+Using Blender every day, you get to change little things on it to speedup
+your workflow. The problem is when you have to switch computers with
+somebody else's Blender, it sucks.
+That's the main reason behind Amaranth. I ported all sort of little changes
+I find useful into this addon.
+
+What is it about? Anything, whatever I think it can speedup workflow,
+I'll try to add it. Enjoy <3
+"""
+
+import sys
+
+# import amaranth's modules
+
+# NOTE: avoid local imports whenever possible!
+# Thanks to Christopher Crouzet for let me know about this.
+# http://stackoverflow.com/questions/13392038/python-making-a-class-variable-static-even-when-a-module-is-imported-in-differe
+
+from amaranth import prefs
+
+from amaranth.modeling import symmetry_tools
+
+from amaranth.scene import (
+    refresh,
+    save_reload,
+    current_blend,
+    stats,
+    goto_library,
+    debug,
+    material_remove_unassigned,
+    )
+
+from amaranth.node_editor import (
+    id_panel,
+    display_image,
+    templates,
+    simplify_nodes,
+    node_stats,
+    normal_node,
+    switch_material,
+    node_shader_extra,
+    )
+
+from amaranth.render import (
+    border_camera,
+    meshlight_add,
+    meshlight_select,
+    passepartout,
+    only_render,
+    unsimplify,
+    final_resolution,
+    samples_scene,
+    remember_layers,
+    render_output_z,
+    )
+
+from amaranth.animation import (
+    timeline_extra_info,
+    frame_current,
+    motion_paths,
+    jump_frames,
+    )
+
+from amaranth.misc import (
+    dopesheet_grapheditor,
+    color_management,
+    dupli_group_id,
+    toggle_wire,
+    sequencer_extra_info,
+    )
+
+
+# register the addon + modules found in globals()
+bl_info = {
+    "name": "Amaranth Toolset",
+    "author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez",
+    "version": (1, 0, 0),
+    "blender": (2, 73),
+    "location": "Everywhere!",
+    "description": "A collection of tools and settings to improve productivity",
+    "warning": "",
+    "wiki_url": "http://pablovazquez.org/amaranth",
+    "tracker_url": "",
+    "category": "Scene",
+}
+
+
+def _call_globals(attr_name):
+    for m in globals().values():
+        if hasattr(m, attr_name):
+            getattr(m, attr_name)()
+
+
+def _flush_modules(pkg_name):
+    pkg_name = pkg_name.lower()
+    for k in tuple(sys.modules.keys()):
+        if k.lower().startswith(pkg_name):
+            del sys.modules[k]
+
+
+def register():
+    _call_globals("register")
+
+
+def unregister():
+    _call_globals("unregister")
+    _flush_modules("amaranth")  # reload amaranth
diff --git a/amaranth/animation/__init__.py b/amaranth/animation/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/amaranth/animation/frame_current.py b/amaranth/animation/frame_current.py
new file mode 100644
index 0000000..538931c
--- /dev/null
+++ b/amaranth/animation/frame_current.py
@@ -0,0 +1,42 @@
+#  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.
+"""
+Current Frame Slider
+
+Currently the only way to change the current frame is to have a Timeline
+editor open, but sometimes you don't have one, or you're fullscreen.
+This option adds the Current Frame slider to the Specials menu. Find it
+hitting the W menu in Object mode, you can slide or click in the middle
+of the button to set the frame manually.
+"""
+
+import bpy
+
+
+def button_frame_current(self, context):
+    preferences = context.user_preferences.addons["amaranth"].preferences
+    scene = context.scene
+    if preferences.use_frame_current:
+        self.layout.separator()
+        self.layout.prop(scene, "frame_current", text="Set Current Frame")
+
+
+def register():
+    bpy.types.VIEW3D_MT_object_specials.append(button_frame_current)
+    bpy.types.VIEW3D_MT_pose_specials.append(button_frame_current)
+
+
+def unregister():
+    bpy.types.VIEW3D_MT_object_specials.remove(button_frame_current)
+    bpy.types.VIEW3D_MT_pose_specials.remove(button_frame_current)
diff --git a/amaranth/animation/jump_frames.py b/amaranth/animation/jump_frames.py
new file mode 100644
index 0000000..5f4ca0c
--- /dev/null
+++ b/amaranth/animation/jump_frames.py
@@ -0,0 +1,196 @@
+#  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.
+"""
+Jump X Frames on Shift Up/Down
+
+When you hit Shift Up/Down, you'll jump 10 frames forward/backwards.
+Sometimes is nice to tweak that value.
+
+In the User Preferences, Editing tab, you'll find a "Frames to Jump"
+slider where you can adjust how many frames you'd like to move
+forwards/backwards.
+
+Make sure you save your user settings if you want to use this value from
+now on.
+
+Find it on the User Preferences, Editing.
+"""
+
+import bpy
+
+KEYMAPS = list()
+
+
+# FUNCTION: Check if object has keyframes for a specific frame
+def is_keyframe(ob, frame):
+    if ob is not None and ob.animation_data is not None and ob.animation_data.action is not None:
+        for fcu in ob.animation_data.action.fcurves:
+            if frame in (p.co.x for p in fcu.keyframe_points):
+                return True
+    return False
+
+# monkey path is_keyframe function
+bpy.types.Object.is_keyframe = is_keyframe
+
+
+# FEATURE: Jump to frame in-between next and previous keyframe
+class AMTH_SCREEN_OT_keyframe_jump_inbetween(bpy.types.Operator):
+
+    """Jump to half in-between keyframes"""
+    bl_idname = "screen.amth_keyframe_jump_inbetween"
+    bl_label = "Jump to Keyframe In-between"
+    backwards = bpy.props.BoolProperty()
+
+    def execute(self, context):
+        back = self.backwards
+
+        scene = context.scene
+        ob = bpy.context.object
+        frame_start = scene.frame_start
+        frame_end = scene.frame_end
+
+        if not context.scene.get("amth_keyframes_jump"):
+            context.scene["amth_keyframes_jump"] = list()
+
+        keyframes_list = context.scene["amth_keyframes_jump"]
+
+        for f in range(frame_start, frame_end):
+            if ob.is_keyframe(f):
+                keyframes_list = list(keyframes_list)
+                keyframes_list.append(f)
+
+        if keyframes_list:
+            keyframes_list_half = []
+
+            for i, item in enumerate(keyframes_list):
+                try:
+                    next_item = keyframes_list[i + 1]
+                    keyframes_list_half.append(int((item + next_item) / 2))
+                except:
+                    pass
+
+            if len(keyframes_list_half) > 1:
+                if back:
+                    v = (scene.frame_current == keyframes_list_half[::-1][-1],
+                         scene.frame_current < keyframes_list_half[::-1][-1])
+                    if any(v):
+                        self.report({"INFO"}, "No keyframes behind")
+                    else:
+                        for i in keyframes_list_half[::-1]:
+                            if scene.frame_current > i:
+                                scene.frame_current = i
+                                break
+                else:
+                    v = (scene.frame_current == keyframes_list_half[-1],
+                         scene.frame_current > keyframes_list_half[-1])
+                    if any(v):
+                        self.report({"INFO"}, "No keyframes ahead")
+                    else:
+                        for i in keyframes_list_half:
+                            if scene.frame_current < i:
+                                scene.frame_current = i
+                                break
+            else:
+                self.report({"INFO"}, "Object has only 1 keyframe")
+        else:
+            self.report({"INFO"}, "Object has no keyframes")
+
+        return {"FINISHED"}
+
+
+# FEATURE: Jump forward/backward every N frames
+class AMTH_SCREEN_OT_frame_jump(bpy.types.Operator):
+
+    """Jump a number of frames forward/backwards"""
+    bl_idname = "screen.amaranth_frame_jump"
+    bl_label = "Jump Frames"
+
+    forward = bpy.props.BoolProperty(default=True)
+
+    def execute

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list