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.
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()