-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanel.py
97 lines (89 loc) · 5.02 KB
/
panel.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
import bpy
class Panel(bpy.types.Panel):
"""Creates a Panel in the scene context of the properties editor"""
bl_label = "Smoothing Setting"
bl_idname = "CC_PT_panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_context = "mesh_edit"
bl_category = "Smoothing"
def draw(self, context):
layout = self.layout
#===============================================================================================================
layout.label(text="Smooth Setting")
box = layout.box()
col = box.column(align=True)
row = col.row(align=True)
# Smooth selected button
row.operator("object.anglesmoothing_operator", icon = "LINCURVE", text = "Smooth")
# Smoothing angle value
row.scale_x = 0.5
row.prop(context.scene, "angle_smooth")
# Smooth button
col.operator("object.smoothing_operator", icon = "SPHERECURVE", text = "Smooth Selected")
# Hard selected button
col.operator("object.hard_operator", icon = "NOCURVE", text = "Harden Selected")
#===============================================================================================================
#===============================================================================================================
layout.label(text="Selection")
box = layout.box()
col = box.column(align=True)
row = col.row(align=True)
row.operator("object.growselect_operator", text = "Grow")
row.operator("object.shrinkselect_operator", text = "Shrink")
row = col.row(align=True)
row.operator("object.loopselect_operator", text = "Loop")
row.operator("object.ringselect_operator", text = "Ring")
row = col.row(align=True)
# Button to selet faces by angle
row.operator("object.angleselect_operator", icon = "RESTRICT_SELECT_OFF",text = "Select by")
# Angle select value
row.scale_x = 0.5
row.prop(context.scene, "angle_select")
# Button to select sharp edges button
col.operator("object.sharpselect_operator", icon = "OUTLINER_DATA_EMPTY", text = "Select Sharp Edges")
col = box.column(align=True)
col.operator("object.boundryselect_operator", icon = "DECORATE_ANIMATE", text = "Select Outter Loop")
col.operator("object.innerselect_operator", icon = "DECORATE_KEYFRAME", text = "Select Inner Face")
#===============================================================================================================
#===============================================================================================================
layout.label(text="Sharp Edges to")
box = layout.box()
col = box.column(align=True)
# Button set sharp edges's bevel weight to 1
col.operator("object.sharpbevel_operator", icon = "STYLUS_PRESSURE", text = "Weight 1")
# Button to convert sharp edges to seams
col.operator("object.sharpseam_operator", icon = "DRIVER_DISTANCE", text = "Seams")
#===============================================================================================================
#===============================================================================================================
layout.label(text="Clear")
box = layout.box()
row = box.row(align=True)
# Button to clear selected sharp edges
row.operator("object.clearsharp_operator", text = "Sharp")
# Button to set selected sharp edges' bevel weight to 0
row.operator("object.clearbevel_operator", text = "Weight")
# Button to clear selected sharp edges' seams
row.operator("object.clearseam_operator", text = "Seams")
#===============================================================================================================
#===============================================================================================================
layout.label(text="Align")
box = layout.box()
row = box.row(align=True)
# Buttons to align seleted to X,Y,Z
split = row.split()
col = split.column()
col.operator('object.xalign_operator', text = "X")
col = split.column()
col.operator("object.yalign_operator", text = "Y")
col = split.column()
col.operator("object.zalign_operator", text = "Z")
#===============================================================================================================
#===============================================================================================================
layout.label(text="Align")
box = layout.box()
row = box.row(align=True)
row.operator("object.lightrotate_operator")
view = context.space_data
shading = view.shading
row.prop(shading, "studiolight_rotate_z", text="Rotation")