forked from bnpr/Abnormal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.py
39 lines (33 loc) · 1.21 KB
/
ui.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
import bpy
from bpy.props import *
from bpy.types import UIList, Panel, Operator
from .properties import *
from .operators_modal import *
class ABN_PT_abnormal_panel(Panel):
"""Creates a Panel in the scene context of the properties editor"""
bl_label = "Tools"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'BNPR Abnormal'
def draw(self, context):
layout = self.layout
scn = context.scene
data = bpy.data
objs = data.objects
aobj = context.active_object
scn_prop = scn.abnormal_props
row = layout.row(align=True)
row.alignment = 'CENTER'
row.operator("abnormal.normal_editor_modal")
row.alignment = 'CENTER'
row.scale_y = 2
ob = context.active_object
if scn_prop.object != '':
if scn_prop.object in data.objects:
ob = data.objects[scn_prop.object]
if ob != None:
row = layout.row(align=True)
row.alignment = 'CENTER'
row.prop_search(scn_prop, 'vertex_group', ob,
'vertex_groups', text='Filter Vertex Group')
row.alignment = 'CENTER'