-
Notifications
You must be signed in to change notification settings - Fork 32
/
rigify_select_pie_menu.py
156 lines (108 loc) · 3.74 KB
/
rigify_select_pie_menu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
###########################################
# RigifyPicker Addon download Link
#
# Downloads | Salva Artero
# http://salvadorartero.com/downloads/
###########################################
#
# THIS SCRIPT IS LICENSED UNDER GPL,
# please read the license block.
#
# ##### 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": "rigify select Pie menu",
"author": "Bookyakuno",
"version": (1, 0, 0),
"blender": (2,77,0),
"description": "rigify rig Quick Select. ",
"location": "Pose mode > Ctrl + W",
"category": "Pie menu",
"warning": "Use RigifyPicker Addon !! http://salvadorartero.com/downloads/"
}
import bpy
from bpy.types import Menu
import bpy, os
from bpy.types import Menu, Header
from bpy.props import IntProperty, FloatProperty, BoolProperty
import bmesh
from mathutils import *
import math
class rigify_select_Prefs(bpy.types.AddonPreferences):
bl_idname = __name__
bpy.types.Scene.Enable_Tab_01 = bpy.props.BoolProperty(default=False)
def draw(self, context):
layout = self.layout
layout.prop(context.scene, "Enable_Tab_01", text="Info", icon="QUESTION")
if context.scene.Enable_Tab_01:
row = layout.row()
layout.label(text="timeline")
layout.label(text="RigifyPicker Addon download Link")
row.operator("wm.url_open", text="Downloads | Salva Artero").url = "http://salvadorartero.com/downloads/"
##################
# Pie Menu Class #
##################
class rigify_select_x(Menu):
bl_idname = "object.rigify_select"
bl_label = "Add Modifier"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
#4 - LEFT
pie.operator("operador.mano_r", text="hand.ik.R", icon='HAND')
#6 - RIGHT
pie.operator("operador.mano_l", text="hand.ik.L", icon='HAND')
#2 - BOTTOM
pie.operator("operador.torso", text="Torso", icon='MONKEY')
#8 - TOP
pie.operator("operador.cabeza", text="Head", icon='BLENDER')
#7 - TOP - LEFT
pie.operator("operador.rodilla_r", text="foot_ROOL.R", icon='CURSOR')
#9 - TOP - RIGHT
pie.operator("operador.rodilla_l", text="foot_ROOL.L", icon='CURSOR')
#1 - BOTTOM - LEFT
pie.operator("operador.pie_r", text="foot.R", icon='EXPORT')
#3 - BOTTOM - RIGHT
pie.operator("operador.pie_l", text="foot.L", icon='EXPORT')
############
# Register #
############
addon_keymaps = []
def register():
bpy.utils.register_class(rigify_select_x)
### Keymap ###
wm = bpy.context.window_manager
km = wm.keyconfigs.addon.keymaps.new(name="Pose")
kmi = km.keymap_items.new("wm.call_menu_pie", "W", "PRESS", ctrl=True)
kmi.properties.name="object.rigify_select"
addon_keymaps.append(km)
##############
# Unregister #
##############
def unregister():
bpy.utils.unregister_class(rigify_select_x)
### Keymap ###
for km in addon_keymaps:
for kmi in km.keymap_items:
km.keymap_items.remove(kmi)
wm.keyconfigs.addon.keymaps.remove(km)
# clear the list
del addon_keymaps[:]
if __name__ == "__main__":
register()
#bpy.ops.wm.call_menu_pie(name="object.rigify_select")