forked from commanderson/CA_ASW_Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLOBALS.py
43 lines (34 loc) · 1.2 KB
/
GLOBALS.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
#----------------------------------------------------------
# File GLOBALS.py
#----------------------------------------------------------
import bpy
G_ColorDir = None
G_BaseFolder = None
G_ColorFolders = None
# - Popup
def ShowMessageBox(title = "Message Box", icon = 'INFO', lines=""):
myLines=lines
def draw(self, context):
for n in myLines:
self.layout.label(text=n)
self.layout.ui_units_x = 20
bpy.context.window_manager.popup_menu(draw, title = title, icon = icon)
def Armature_Item_Callback(self, context):
items = [("None", "Select Armature", "")]
for item in bpy.context.scene.objects:
if item.type == "ARMATURE":
items.append((item.name, item.name, ""))
return items
# - Armature Dropdown Properties
class ArmatureDrop(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Scene.arm_items = bpy.props.PointerProperty(type=ArmatureDrop)
@classmethod
def unregister(cls):
del bpy.types.Scene.arm_items
armatureComboBox : bpy.props.EnumProperty(
name="",
description="Armatures in Scene",
items= Armature_Item_Callback
)