[Addon] Misc Anim Tools

Hello all!

Here is my first addon for Blender: Misc Anim Tools!


This is a simple addon that takes common animation tools and sticks them into one place in the properties panel. This script is greatly inspired off of the ‘Freen’s Animation Tools’ addon by Beorn Leonard, and I actually found out how to add two features in by looking at the code for that script. The rest of it I stole from Blender itself. :slight_smile:

If anyone wants any features, let me know!

Here is the link for the download.

Here is the code:

# ##### 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 #####

# <pep8 compliant>

bl_info = {
    "name": "Misc Anim Tools",
    "author": "John Montgomery",
    "version": (2, 0),
    "blender": (2, 7, 1),
    "location": "View3D > Properties > Misc Anim Tools",
    "description": "A panel for animators that puts tools in one place",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Animation"}


import bpy
from bpy.types import Header, Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
from bpy.app.translations import contexts as i18n_contexts

class showButtons (bpy.types.Panel):
    bl_label = "Misc Anim Tools"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"   
    bl_options = {'DEFAULT_CLOSED'}    
    
    def draw(self, context):
        layout = self.layout

#......................The Misc Tools On The Top........................................
        
        row = layout.row()
        row.label(text="", icon='AUTOMERGE_OFF')
        row.prop(context.scene.render, "use_simplify", text = "Simplify")
        row.prop(context.scene.render, "simplify_subdivision", text="Subdivision levels")
 
        row = layout.row()
        row = layout.row()        
        row = layout.row()
        row = layout.row()

        row.label(text="Handle type:", icon='IPO')
        row = layout.row()                
        row.prop(context.user_preferences.edit, "keyframe_new_interpolation_type", text="") 

#...............................The Viewport Tools...........................................
        
        row = layout.row()
        row = layout.row()                
        row = layout.row()
        row = layout.row()        
        row.label(text="Viewport:")
                
        view = context.space_data
        scene = context.scene
        gs = scene.game_settings
        obj = context.object

        col = layout.column()
        
        if view.viewport_shade == 'TEXTURED':
            if scene.render.use_shading_nodes or gs.material_mode != 'GLSL':
                col.prop(view, "show_textured_shadeless", text = "Display Shadeless", icon='SNAP_VOLUME')
                
        view = context.space_data
        scene = context.scene

        col = layout.column()
        col.prop(view, "show_only_render", icon='RENDER_STILL')

        col = layout.column()         
                
        ob = context.object
        
        if ob:  
            col.prop(ob, "show_x_ray", text="X-Ray Bones", icon = 'OUTLINER_DATA_ARMATURE')

#...............................The Animation Tools...........................................
   
        row = layout.row()
        row = layout.row()        
        row = layout.row()
        row = layout.row()
        row.label(text="Animation:")
        row = layout.row()
         
        row.operator("screen.animation_play", text="Play Animation Backwards", icon='REC').reverse = True
        
        row = layout.row()
        
        row = layout.row(align=True)
        row.operator("render.opengl", text="Render OpenGL Animation", icon='RENDER_ANIMATION').animation = True
        
        row = layout.row()
        
        row.operator("pose.paths_calculate", text="Calculate Path", icon = 'ANIM_DATA')
        row.operator("pose.paths_clear", text="Clear Path", icon = 'ANIM_DATA')

#...............................The Keyframe Tools...........................................
        
        row = layout.row()
        row = layout.row()
        row = layout.row()
        row = layout.row()
                
        row.label(text="Keyframes:")
        row = layout.row()
        row.operator("anim.keyframe_insert_menu", text="Insert")
        row.operator("anim.keyframe_delete_v3d", text="Remove")

        row = layout.row()

        row.operator("pose.breakdown", text="Breakdowner")

def register():
    bpy.utils.register_module(__name__)


def unregister():
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()     


This looks to be a helpful addon for those of us who do animation.

You actually included a feature that I never knew about, “breakdown” I’ll have to try and figure out what this does. Did you do any testing with any slightly older versions of blender, like 2.69?

Did you do any testing with any slightly older versions of blender, like 2.69?

I didn’t test with 2.69-I’m new to the world of scripting, and the thought never even crossed my mind. Now that I read your comment, I did a little bit of it, and it doesn’t seem to work with older Blender versions. When I remove the code that doesn’t work with older versions, it doesn’t seem to work with 2.71… so I guess it only works with the newest Blender versions. (Sorry everyone with older Blender versions)

You actually included a feature that I never knew about, “breakdown” I’ll have to try and figure out what this does

The breakdowner is tool that moves an armature to a place between two keyframes. With a breakdown at 50%, the armature will be exactly in the middle of the two keyframes. You can move the percentage up or down by moving your mouse left and right. Note: This only works in pose mode, and works best with constant interpolation.