Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mocap
diff options
context:
space:
mode:
authormeta-androcto <meta.androcto1@gmail.com>2017-01-16 14:30:34 +0300
committermeta-androcto <meta.androcto1@gmail.com>2017-01-16 14:30:34 +0300
commite264efb7e8424d300d49fe99d87f9f279d40fe09 (patch)
tree9481fb5b9e4383bdc0fff84c75fbd1202946f956 /mocap
parent21781083e41ffd102f6bf32e3e023fcaf1faab9f (diff)
Mocap Tools: context sensitive panels (armature selected) T50357
Diffstat (limited to 'mocap')
-rw-r--r--mocap/__init__.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/mocap/__init__.py b/mocap/__init__.py
index 729848e2..27b166ab 100644
--- a/mocap/__init__.py
+++ b/mocap/__init__.py
@@ -23,7 +23,7 @@ bl_info = {
"author": "Benjy Cook",
"blender": (2, 73, 0),
"version": (1, 1, 1),
- "location": "Object UI > Mocap tools",
+ "location": "Active Armature > Object Properties > Mocap tools",
"description": "Various tools for working with motion capture animation",
"warning": "",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
@@ -269,6 +269,13 @@ class MocapPanel(bpy.types.Panel):
bl_region_type = "WINDOW"
bl_context = "object"
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ return obj.type == 'ARMATURE' and context.active_object is not None and context.mode in {'EDIT_ARMATURE',
+ 'POSE',
+ 'OBJECT'}
+
def draw(self, context):
layout = self.layout
@@ -349,6 +356,14 @@ class MocapConstraintsPanel(bpy.types.Panel):
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ return obj.type == 'ARMATURE' and context.active_object is not None and context.mode in {'EDIT_ARMATURE',
+ 'POSE',
+ 'OBJECT'}
def draw(self, context):
layout = self.layout
@@ -405,7 +420,14 @@ class ExtraToolsPanel(bpy.types.Panel):
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
+ bl_options = {'DEFAULT_CLOSED'}
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ return obj.type == 'ARMATURE' and context.active_object is not None and context.mode in {'EDIT_ARMATURE',
+ 'POSE',
+ 'OBJECT'}
def draw(self, context):
layout = self.layout
layout.operator("mocap.samples", text='Samples to Beziers')