@@ -12,6 +12,49 @@ class _PanelBase(object):
1212 bl_category = 'mmd_tools'
1313
1414
15+ class MMDToolsObjectPanel (_PanelBase , Panel ):
16+ bl_idname = 'OBJECT_PT_mmd_tools_object'
17+ bl_label = 'Operator'
18+ bl_context = ''
19+
20+ def draw (self , context ):
21+ active_obj = context .active_object
22+
23+ layout = self .layout
24+
25+ col = layout .column (align = True )
26+ col .label ('Edit:' )
27+ row = col .row (align = True )
28+ row .operator (operators .model .CreateMMDModelRoot .bl_idname , text = 'Create Model' )
29+ row .operator (operators .fileio .ImportPmx .bl_idname , text = 'Import Model' )
30+ if active_obj is not None and active_obj .type == 'MESH' :
31+ col = layout .column (align = True )
32+ col .operator ('mmd_tools.separate_by_materials' , text = 'Separate By Materials' )
33+
34+ if active_obj is None :
35+ return
36+
37+ root = mmd_model .Model .findRoot (active_obj )
38+ if root is None :
39+ return
40+
41+ col = self .layout .column (align = True )
42+ col .label ('Rigidbody:' )
43+ row = col .row (align = True )
44+ row .operator ('mmd_tools.build_rig' )
45+ row .operator ('mmd_tools.clean_rig' )
46+ if not root .mmd_root .is_built :
47+ col .label (text = 'Press the "Build" button before playing the physical animation.' , icon = 'ERROR' )
48+
49+ col .label ('Bone Constraints:' )
50+ col .operator ('mmd_tools.apply_additioinal_transform' )
51+
52+ col = self .layout .column (align = True )
53+ col .label ('Import/Export:' )
54+ col .operator (operators .fileio .ImportVmdToMMDModel .bl_idname , text = 'Import Motion' )
55+ col .operator (operators .fileio .ExportPmx .bl_idname , text = 'Export Model' )
56+
57+
1558class MMD_ROOT_UL_display_item_frames (UIList ):
1659 def draw_item (self , context , layout , data , item , icon , active_data , active_propname , index ):
1760 mmd_root = data
@@ -43,9 +86,11 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
4386 layout .alignment = 'CENTER'
4487 layout .label (text = "" , icon_value = icon )
4588
89+
4690class MMDDisplayItemsPanel (_PanelBase , Panel ):
4791 bl_idname = 'OBJECT_PT_mmd_tools_display_items'
48- bl_label = 'MMD Display Items'
92+ bl_label = 'Display Items'
93+ bl_options = {'DEFAULT_CLOSED' }
4994
5095 def draw (self , context ):
5196 active_obj = context .active_object
@@ -113,100 +158,3 @@ def draw(self, context):
113158 row = col .row (align = True )
114159 row .label (i .name + ':' )
115160 row .prop (i .data .shape_keys .key_blocks [item .name ], 'value' )
116-
117-
118- class MMDRootView3DPanel (_PanelBase , Panel ):
119- bl_idname = 'OBJECT_PT_mmd_tools_root'
120- bl_label = 'MMD Model Tools'
121- bl_context = ''
122-
123- def draw (self , context ):
124- layout = self .layout
125- obj = context .active_object
126-
127- if obj is None :
128- c = layout .column ()
129- c .label ('No object is selected.' )
130- return
131-
132- root = mmd_model .Model .findRoot (obj )
133- if root is None :
134- c = layout .column ()
135- c .label ('Create MMD Model' )
136- return
137-
138- col = self .layout .column (align = True )
139-
140- if not root .mmd_root .is_built :
141- col .label (text = 'Press the "Build" button before playing the physical animation.' , icon = 'ERROR' )
142- row = col .row (align = True )
143- row .operator ('mmd_tools.build_rig' )
144- row .operator ('mmd_tools.clean_rig' )
145- col .operator ('mmd_tools.apply_additioinal_transform' )
146-
147- col = self .layout .column (align = True )
148- col .operator (operators .fileio .ImportVmdToMMDModel .bl_idname , text = 'Import Motion' )
149- col .operator (operators .fileio .ExportPmx .bl_idname , text = 'Export Model' )
150-
151-
152- class MMDModelObjectPanel (_PanelBase , Panel ):
153- bl_idname = 'OBJECT_PT_mmd_tools_root_object'
154- bl_label = 'MMD Model Information'
155- bl_space_type = 'PROPERTIES'
156- bl_region_type = 'WINDOW'
157- bl_context = 'object'
158-
159- @classmethod
160- def poll (cls , context ):
161- obj = context .active_object
162- if obj is None :
163- return False
164-
165- root = mmd_model .Model .findRoot (obj )
166- if root is None :
167- return False
168-
169- return True
170-
171- def draw (self , context ):
172- layout = self .layout
173- obj = context .active_object
174-
175- root = mmd_model .Model .findRoot (obj )
176-
177- c = layout .column ()
178- c .prop (root .mmd_root , 'name' )
179- c .prop (root .mmd_root , 'name_e' )
180- c .prop (root .mmd_root , 'scale' )
181-
182- class MMDToolsObjectPanel (_PanelBase , Panel ):
183- bl_idname = 'OBJECT_PT_mmd_tools_object'
184- bl_label = 'Object'
185- bl_context = ''
186-
187- def draw (self , context ):
188- active_obj = context .active_object
189-
190- layout = self .layout
191-
192- col = layout .column ()
193- col .label ('Model:' )
194- c = col .column (align = True )
195- c .operator (operators .model .CreateMMDModelRoot .bl_idname , text = 'Create' )
196- c .operator (operators .fileio .ImportPmx .bl_idname , text = 'Import' )
197-
198- col .label ('Motion(vmd):' )
199- c = col .column ()
200- c .operator ('mmd_tools.import_vmd' , text = 'Import' )
201-
202-
203- if active_obj is not None and active_obj .type == 'MESH' :
204- col = layout .column (align = True )
205- col .label ('Mesh:' )
206- c = col .column ()
207- c .operator ('mmd_tools.separate_by_materials' , text = 'Separate by materials' )
208-
209- col = layout .column (align = True )
210- col .label ('Scene:' )
211- c = col .column (align = True )
212- c .operator ('mmd_tools.set_frame_range' , text = 'Set frame range' )
0 commit comments