1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
21 from bpy.types import Panel
22 from bpy.app.translations import pgettext_iface as iface_
25 class ModifierButtonsPanel:
26 bl_space_type = 'PROPERTIES'
27 bl_region_type = 'WINDOW'
28 bl_context = "modifier"
29 bl_options = {'HIDE_HEADER'}
32 class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
33 bl_label = "Modifiers"
35 def draw(self, context):
40 layout.operator_menu_enum("object.modifier_add", "type")
42 for md in ob.modifiers:
43 box = layout.template_modifier(md)
45 # match enum type to our functions, avoids a lookup table.
46 getattr(self, md.type)(box, ob, md)
48 # the mt.type enum is (ab)used for a lookup on function names
49 # ...to avoid lengthy if statements
50 # so each type must have a function here.
52 def ARMATURE(self, layout, ob, md):
53 split = layout.split()
56 col.label(text="Object:")
57 col.prop(md, "object", text="")
58 col.prop(md, "use_deform_preserve_volume")
61 col.label(text="Bind To:")
62 col.prop(md, "use_vertex_groups", text="Vertex Groups")
63 col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
67 split = layout.split()
69 row = split.row(align=True)
70 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
71 sub = row.row(align=True)
72 sub.active = bool(md.vertex_group)
73 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
75 split.prop(md, "use_multi_modifier")
77 def ARRAY(self, layout, ob, md):
78 layout.prop(md, "fit_type")
80 if md.fit_type == 'FIXED_COUNT':
81 layout.prop(md, "count")
82 elif md.fit_type == 'FIT_LENGTH':
83 layout.prop(md, "fit_length")
84 elif md.fit_type == 'FIT_CURVE':
85 layout.prop(md, "curve")
89 split = layout.split()
92 col.prop(md, "use_constant_offset")
94 sub.active = md.use_constant_offset
95 sub.prop(md, "constant_offset_displace", text="")
99 col.prop(md, "use_merge_vertices", text="Merge")
101 sub.active = md.use_merge_vertices
102 sub.prop(md, "use_merge_vertices_cap", text="First Last")
103 sub.prop(md, "merge_threshold", text="Distance")
106 col.prop(md, "use_relative_offset")
108 sub.active = md.use_relative_offset
109 sub.prop(md, "relative_offset_displace", text="")
113 col.prop(md, "use_object_offset")
115 sub.active = md.use_object_offset
116 sub.prop(md, "offset_object", text="")
120 layout.prop(md, "start_cap")
121 layout.prop(md, "end_cap")
123 def BEVEL(self, layout, ob, md):
124 split = layout.split()
127 col.prop(md, "width")
128 col.prop(md, "segments")
129 col.prop(md, "profile")
130 col.prop(md, "material")
133 col.prop(md, "use_only_vertices")
134 col.prop(md, "use_clamp_overlap")
135 col.prop(md, "loop_slide")
137 layout.label(text="Limit Method:")
138 layout.row().prop(md, "limit_method", expand=True)
139 if md.limit_method == 'ANGLE':
140 layout.prop(md, "angle_limit")
141 elif md.limit_method == 'VGROUP':
142 layout.label(text="Vertex Group:")
143 layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
145 layout.label(text="Width Method:")
146 layout.row().prop(md, "offset_type", expand=True)
148 def BOOLEAN(self, layout, ob, md):
149 split = layout.split()
152 col.label(text="Operation:")
153 col.prop(md, "operation", text="")
156 col.label(text="Object:")
157 col.prop(md, "object", text="")
160 layout.prop(md, "use_bmesh")
163 box.label("BMesh Options:")
164 box.prop(md, "use_bmesh_separate")
165 box.prop(md, "use_bmesh_dissolve")
166 box.prop(md, "use_bmesh_connect_regions")
167 box.prop(md, "threshold")
170 def BUILD(self, layout, ob, md):
171 split = layout.split()
174 col.prop(md, "frame_start")
175 col.prop(md, "frame_duration")
176 col.prop(md, "use_reverse")
179 col.prop(md, "use_random_order")
181 sub.active = md.use_random_order
184 def MESH_CACHE(self, layout, ob, md):
185 layout.prop(md, "cache_format")
186 layout.prop(md, "filepath")
188 layout.label(text="Evaluation:")
189 layout.prop(md, "factor", slider=True)
190 layout.prop(md, "deform_mode")
191 layout.prop(md, "interpolation")
193 layout.label(text="Time Mapping:")
196 row.prop(md, "time_mode", expand=True)
198 row.prop(md, "play_mode", expand=True)
199 if md.play_mode == 'SCENE':
200 layout.prop(md, "frame_start")
201 layout.prop(md, "frame_scale")
203 time_mode = md.time_mode
204 if time_mode == 'FRAME':
205 layout.prop(md, "eval_frame")
206 elif time_mode == 'TIME':
207 layout.prop(md, "eval_time")
208 elif time_mode == 'FACTOR':
209 layout.prop(md, "eval_factor")
211 layout.label(text="Axis Mapping:")
212 split = layout.split(percentage=0.5, align=True)
213 split.alert = (md.forward_axis[-1] == md.up_axis[-1])
214 split.label("Forward/Up Axis:")
215 split.prop(md, "forward_axis", text="")
216 split.prop(md, "up_axis", text="")
217 split = layout.split(percentage=0.5)
218 split.label(text="Flip Axis:")
220 row.prop(md, "flip_axis")
222 def CAST(self, layout, ob, md):
223 split = layout.split(percentage=0.25)
225 split.label(text="Cast Type:")
226 split.prop(md, "cast_type", text="")
228 split = layout.split(percentage=0.25)
231 col.prop(md, "use_x")
232 col.prop(md, "use_y")
233 col.prop(md, "use_z")
236 col.prop(md, "factor")
237 col.prop(md, "radius")
239 col.prop(md, "use_radius_as_size")
241 split = layout.split()
244 col.label(text="Vertex Group:")
245 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
247 col.label(text="Control Object:")
248 col.prop(md, "object", text="")
250 col.prop(md, "use_transform")
252 def CLOTH(self, layout, ob, md):
253 layout.label(text="Settings are inside the Physics tab")
255 def COLLISION(self, layout, ob, md):
256 layout.label(text="Settings are inside the Physics tab")
258 def CURVE(self, layout, ob, md):
259 split = layout.split()
262 col.label(text="Object:")
263 col.prop(md, "object", text="")
265 col.label(text="Vertex Group:")
266 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
267 layout.label(text="Deformation Axis:")
268 layout.row().prop(md, "deform_axis", expand=True)
270 def DECIMATE(self, layout, ob, md):
271 decimate_type = md.decimate_type
274 row.prop(md, "decimate_type", expand=True)
276 if decimate_type == 'COLLAPSE':
277 has_vgroup = bool(md.vertex_group)
278 layout.prop(md, "ratio")
280 split = layout.split()
283 row = col.row(align=True)
284 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
285 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
291 row.active = has_vgroup
292 row.prop(md, "vertex_group_factor")
294 col.prop(md, "use_collapse_triangulate")
295 row = col.split(percentage=0.75)
296 row.prop(md, "use_symmetry")
297 row.prop(md, "symmetry_axis", text="")
299 elif decimate_type == 'UNSUBDIV':
300 layout.prop(md, "iterations")
302 else: # decimate_type == 'DISSOLVE':
303 layout.prop(md, "angle_limit")
304 layout.prop(md, "use_dissolve_boundaries")
305 layout.label("Delimit:")
307 row.prop(md, "delimit")
310 layout_info.label(text=iface_("Faces: %d") % md.face_count, translate=False)
312 def DISPLACE(self, layout, ob, md):
313 has_texture = (md.texture is not None)
315 col = layout.column(align=True)
316 col.label(text="Texture:")
317 col.template_ID(md, "texture", new="texture.new")
319 split = layout.split()
321 col = split.column(align=True)
322 col.label(text="Direction:")
323 col.prop(md, "direction", text="")
324 col.label(text="Vertex Group:")
325 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
327 col = split.column(align=True)
328 col.active = has_texture
329 col.label(text="Texture Coordinates:")
330 col.prop(md, "texture_coords", text="")
331 if md.texture_coords == 'OBJECT':
332 col.label(text="Object:")
333 col.prop(md, "texture_coords_object", text="")
334 elif md.texture_coords == 'UV' and ob.type == 'MESH':
335 col.label(text="UV Map:")
336 col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
341 row.prop(md, "mid_level")
342 row.prop(md, "strength")
344 def DYNAMIC_PAINT(self, layout, ob, md):
345 layout.label(text="Settings are inside the Physics tab")
347 def EDGE_SPLIT(self, layout, ob, md):
348 split = layout.split()
351 col.prop(md, "use_edge_angle", text="Edge Angle")
353 sub.active = md.use_edge_angle
354 sub.prop(md, "split_angle")
356 split.prop(md, "use_edge_sharp", text="Sharp Edges")
358 def EXPLODE(self, layout, ob, md):
359 split = layout.split()
362 col.label(text="Vertex group:")
363 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
365 sub.active = bool(md.vertex_group)
366 sub.prop(md, "protect")
367 col.label(text="Particle UV")
368 col.prop_search(md, "particle_uv", ob.data, "uv_textures", text="")
371 col.prop(md, "use_edge_cut")
372 col.prop(md, "show_unborn")
373 col.prop(md, "show_alive")
374 col.prop(md, "show_dead")
375 col.prop(md, "use_size")
377 layout.operator("object.explode_refresh", text="Refresh")
379 def FLUID_SIMULATION(self, layout, ob, md):
380 layout.label(text="Settings are inside the Physics tab")
382 def HOOK(self, layout, ob, md):
383 use_falloff = (md.falloff_type != 'NONE')
384 split = layout.split()
387 col.label(text="Object:")
388 col.prop(md, "object", text="")
389 if md.object and md.object.type == 'ARMATURE':
390 col.label(text="Bone:")
391 col.prop_search(md, "subtarget", md.object.data, "bones", text="")
393 col.label(text="Vertex Group:")
394 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
398 row = layout.row(align=True)
400 row.prop(md, "falloff_radius")
401 row.prop(md, "strength", slider=True)
402 layout.prop(md, "falloff_type")
404 col = layout.column()
406 if md.falloff_type == 'CURVE':
407 col.template_curve_mapping(md, "falloff_curve")
409 split = layout.split()
412 col.prop(md, "use_falloff_uniform")
414 if ob.mode == 'EDIT':
415 row = col.row(align=True)
416 row.operator("object.hook_reset", text="Reset")
417 row.operator("object.hook_recenter", text="Recenter")
419 row = layout.row(align=True)
420 row.operator("object.hook_select", text="Select")
421 row.operator("object.hook_assign", text="Assign")
423 def LAPLACIANDEFORM(self, layout, ob, md):
426 layout.prop(md, "iterations")
429 row.active = not is_bind
430 row.label(text="Anchors Vertex Group:")
433 row.enabled = not is_bind
434 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
439 row.enabled = bool(md.vertex_group)
440 row.operator("object.laplaciandeform_bind", text="Unbind" if is_bind else "Bind")
442 def LAPLACIANSMOOTH(self, layout, ob, md):
443 layout.prop(md, "iterations")
445 split = layout.split(percentage=0.25)
448 col.label(text="Axis:")
449 col.prop(md, "use_x")
450 col.prop(md, "use_y")
451 col.prop(md, "use_z")
454 col.label(text="Lambda:")
455 col.prop(md, "lambda_factor", text="Factor")
456 col.prop(md, "lambda_border", text="Border")
459 col.prop(md, "use_volume_preserve")
460 col.prop(md, "use_normalized")
462 layout.label(text="Vertex Group:")
463 layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
465 def LATTICE(self, layout, ob, md):
466 split = layout.split()
469 col.label(text="Object:")
470 col.prop(md, "object", text="")
473 col.label(text="Vertex Group:")
474 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
477 layout.prop(md, "strength", slider=True)
479 def MASK(self, layout, ob, md):
480 split = layout.split()
483 col.label(text="Mode:")
484 col.prop(md, "mode", text="")
487 if md.mode == 'ARMATURE':
488 col.label(text="Armature:")
489 row = col.row(align=True)
490 row.prop(md, "armature", text="")
491 sub = row.row(align=True)
492 sub.active = (md.armature is not None)
493 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
494 elif md.mode == 'VERTEX_GROUP':
495 col.label(text="Vertex Group:")
496 row = col.row(align=True)
497 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
498 sub = row.row(align=True)
499 sub.active = bool(md.vertex_group)
500 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
502 def MESH_DEFORM(self, layout, ob, md):
503 split = layout.split()
506 col.enabled = not md.is_bound
507 col.label(text="Object:")
508 col.prop(md, "object", text="")
511 col.label(text="Vertex Group:")
512 row = col.row(align=True)
513 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
514 sub = row.row(align=True)
515 sub.active = bool(md.vertex_group)
516 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
520 row.enabled = not md.is_bound
521 row.prop(md, "precision")
522 row.prop(md, "use_dynamic_bind")
526 layout.operator("object.meshdeform_bind", text="Unbind")
528 layout.operator("object.meshdeform_bind", text="Bind")
530 def MIRROR(self, layout, ob, md):
531 split = layout.split(percentage=0.25)
534 col.label(text="Axis:")
535 col.prop(md, "use_x")
536 col.prop(md, "use_y")
537 col.prop(md, "use_z")
540 col.label(text="Options:")
541 col.prop(md, "use_mirror_merge", text="Merge")
542 col.prop(md, "use_clip", text="Clipping")
543 col.prop(md, "use_mirror_vertex_groups", text="Vertex Groups")
546 col.label(text="Textures:")
547 col.prop(md, "use_mirror_u", text="U")
548 col.prop(md, "use_mirror_v", text="V")
550 col = layout.column()
552 if md.use_mirror_merge is True:
553 col.prop(md, "merge_threshold")
554 col.label(text="Mirror Object:")
555 col.prop(md, "mirror_object", text="")
557 def MULTIRES(self, layout, ob, md):
558 layout.row().prop(md, "subdivision_type", expand=True)
560 split = layout.split()
562 col.prop(md, "levels", text="Preview")
563 col.prop(md, "sculpt_levels", text="Sculpt")
564 col.prop(md, "render_levels", text="Render")
568 col.enabled = ob.mode != 'EDIT'
569 col.operator("object.multires_subdivide", text="Subdivide")
570 col.operator("object.multires_higher_levels_delete", text="Delete Higher")
571 col.operator("object.multires_reshape", text="Reshape")
572 col.operator("object.multires_base_apply", text="Apply Base")
573 col.prop(md, "use_subsurf_uv")
574 col.prop(md, "show_only_control_edges")
578 col = layout.column()
581 row.operator("object.multires_external_pack", text="Pack External")
584 row.prop(md, "filepath", text="")
586 row.operator("object.multires_external_save", text="Save External...")
589 def OCEAN(self, layout, ob, md):
590 if not bpy.app.build_options.mod_oceansim:
591 layout.label("Built without OceanSim modifier")
594 layout.prop(md, "geometry_mode")
596 if md.geometry_mode == 'GENERATE':
598 row.prop(md, "repeat_x")
599 row.prop(md, "repeat_y")
603 split = layout.split()
607 col.prop(md, "depth")
608 col.prop(md, "random_seed")
611 col.prop(md, "resolution")
613 col.prop(md, "spatial_size")
615 layout.label("Waves:")
617 split = layout.split()
620 col.prop(md, "choppiness")
621 col.prop(md, "wave_scale", text="Scale")
622 col.prop(md, "wave_scale_min")
623 col.prop(md, "wind_velocity")
626 col.prop(md, "wave_alignment", text="Alignment")
628 sub.active = (md.wave_alignment > 0.0)
629 sub.prop(md, "wave_direction", text="Direction")
630 sub.prop(md, "damping")
634 layout.prop(md, "use_normals")
636 split = layout.split()
639 col.prop(md, "use_foam")
641 sub.active = md.use_foam
642 sub.prop(md, "foam_coverage", text="Coverage")
645 col.active = md.use_foam
646 col.label("Foam Data Layer Name:")
647 col.prop(md, "foam_layer_name", text="")
652 layout.operator("object.ocean_bake", text="Free Bake").free = True
654 layout.operator("object.ocean_bake").free = False
656 split = layout.split()
657 split.enabled = not md.is_cached
659 col = split.column(align=True)
660 col.prop(md, "frame_start", text="Start")
661 col.prop(md, "frame_end", text="End")
663 col = split.column(align=True)
664 col.label(text="Cache path:")
665 col.prop(md, "filepath", text="")
667 split = layout.split()
668 split.enabled = not md.is_cached
671 col.active = md.use_foam
672 col.prop(md, "bake_foam_fade")
676 def SCREW(self, layout, ob, md):
677 split = layout.split()
681 col.prop(md, "object", text="AxisOb")
682 col.prop(md, "angle")
683 col.prop(md, "steps")
684 col.prop(md, "render_steps")
685 col.prop(md, "use_smooth_shade")
689 row.active = (md.object is None or md.use_object_screw_offset is False)
690 row.prop(md, "screw_offset")
692 row.active = (md.object is not None)
693 row.prop(md, "use_object_screw_offset")
694 col.prop(md, "use_normal_calculate")
695 col.prop(md, "use_normal_flip")
696 col.prop(md, "iterations")
697 col.prop(md, "use_stretch_u")
698 col.prop(md, "use_stretch_v")
700 def SHRINKWRAP(self, layout, ob, md):
701 split = layout.split()
703 col.label(text="Target:")
704 col.prop(md, "target", text="")
706 col.label(text="Vertex Group:")
707 row = col.row(align=True)
708 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
709 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
711 split = layout.split()
714 col.prop(md, "offset")
717 col.label(text="Mode:")
718 col.prop(md, "wrap_method", text="")
720 if md.wrap_method == 'PROJECT':
721 split = layout.split()
723 col.prop(md, "subsurf_levels")
726 col.prop(md, "project_limit", text="Limit")
727 split = layout.split(percentage=0.25)
730 col.label(text="Axis:")
731 col.prop(md, "use_project_x")
732 col.prop(md, "use_project_y")
733 col.prop(md, "use_project_z")
736 col.label(text="Direction:")
737 col.prop(md, "use_negative_direction")
738 col.prop(md, "use_positive_direction")
741 col.label(text="Cull Faces:")
742 col.prop(md, "cull_face", expand=True)
744 layout.prop(md, "auxiliary_target")
746 elif md.wrap_method == 'NEAREST_SURFACEPOINT':
747 layout.prop(md, "use_keep_above_surface")
749 def SIMPLE_DEFORM(self, layout, ob, md):
751 layout.row().prop(md, "deform_method", expand=True)
753 split = layout.split()
756 col.label(text="Vertex Group:")
757 row = col.row(align=True)
758 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
759 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
761 split = layout.split()
764 col.label(text="Axis, Origin:")
765 col.prop(md, "origin", text="")
767 if md.deform_method in {'TAPER', 'STRETCH', 'TWIST'}:
768 col.label(text="Lock:")
769 col.prop(md, "lock_x")
770 col.prop(md, "lock_y")
773 col.label(text="Deform:")
774 if md.deform_method in {'TAPER', 'STRETCH'}:
775 col.prop(md, "factor")
777 col.prop(md, "angle")
778 col.prop(md, "limits", slider=True)
780 def SMOKE(self, layout, ob, md):
781 layout.label(text="Settings are inside the Physics tab")
783 def SMOOTH(self, layout, ob, md):
784 split = layout.split(percentage=0.25)
787 col.label(text="Axis:")
788 col.prop(md, "use_x")
789 col.prop(md, "use_y")
790 col.prop(md, "use_z")
793 col.prop(md, "factor")
794 col.prop(md, "iterations")
795 col.label(text="Vertex Group:")
796 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
798 def SOFT_BODY(self, layout, ob, md):
799 layout.label(text="Settings are inside the Physics tab")
801 def SOLIDIFY(self, layout, ob, md):
802 split = layout.split()
805 col.prop(md, "thickness")
806 col.prop(md, "thickness_clamp")
810 row = col.row(align=True)
811 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
812 sub = row.row(align=True)
813 sub.active = bool(md.vertex_group)
814 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
817 sub.active = bool(md.vertex_group)
818 sub.prop(md, "thickness_vertex_group", text="Factor")
820 col.label(text="Crease:")
821 col.prop(md, "edge_crease_inner", text="Inner")
822 col.prop(md, "edge_crease_outer", text="Outer")
823 col.prop(md, "edge_crease_rim", text="Rim")
827 col.prop(md, "offset")
828 col.prop(md, "use_flip_normals")
830 col.prop(md, "use_even_offset")
831 col.prop(md, "use_quality_normals")
832 col.prop(md, "use_rim")
833 col_rim = col.column()
834 col_rim.active = md.use_rim
835 col_rim.prop(md, "use_rim_only")
839 col.label(text="Material Index Offset:")
842 row = sub.split(align=True, percentage=0.4)
843 row.prop(md, "material_offset", text="")
844 row = row.row(align=True)
845 row.active = md.use_rim
846 row.prop(md, "material_offset_rim", text="Rim")
848 def SUBSURF(self, layout, ob, md):
849 layout.row().prop(md, "subdivision_type", expand=True)
851 split = layout.split()
853 col.label(text="Subdivisions:")
854 col.prop(md, "levels", text="View")
855 col.prop(md, "render_levels", text="Render")
858 col.label(text="Options:")
859 col.prop(md, "use_subsurf_uv")
860 col.prop(md, "show_only_control_edges")
861 if hasattr(md, "use_opensubdiv"):
862 col.prop(md, "use_opensubdiv")
864 def SURFACE(self, layout, ob, md):
865 layout.label(text="Settings are inside the Physics tab")
867 def UV_PROJECT(self, layout, ob, md):
868 split = layout.split()
871 col.label(text="Image:")
872 col.prop(md, "image", text="")
875 col.label(text="UV Map:")
876 col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
878 split = layout.split()
880 col.prop(md, "use_image_override")
881 col.prop(md, "projector_count", text="Projectors")
882 for proj in md.projectors:
883 col.prop(proj, "object", text="")
886 sub = col.column(align=True)
887 sub.prop(md, "aspect_x", text="Aspect X")
888 sub.prop(md, "aspect_y", text="Aspect Y")
890 sub = col.column(align=True)
891 sub.prop(md, "scale_x", text="Scale X")
892 sub.prop(md, "scale_y", text="Scale Y")
894 def WARP(self, layout, ob, md):
895 use_falloff = (md.falloff_type != 'NONE')
896 split = layout.split()
899 col.label(text="From:")
900 col.prop(md, "object_from", text="")
902 col.prop(md, "use_volume_preserve")
905 col.label(text="To:")
906 col.prop(md, "object_to", text="")
907 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
909 col = layout.column()
911 row = col.row(align=True)
912 row.prop(md, "strength")
914 row.prop(md, "falloff_radius")
916 col.prop(md, "falloff_type")
918 if md.falloff_type == 'CURVE':
919 col.template_curve_mapping(md, "falloff_curve")
922 split = layout.split()
924 col.label(text="Texture:")
925 col.template_ID(md, "texture", new="texture.new")
928 col.label(text="Texture Coordinates:")
929 col.prop(md, "texture_coords", text="")
931 if md.texture_coords == 'OBJECT':
932 layout.prop(md, "texture_coords_object", text="Object")
933 elif md.texture_coords == 'UV' and ob.type == 'MESH':
934 layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
936 def WAVE(self, layout, ob, md):
937 split = layout.split()
940 col.label(text="Motion:")
941 col.prop(md, "use_x")
942 col.prop(md, "use_y")
943 col.prop(md, "use_cyclic")
946 col.prop(md, "use_normal")
948 sub.active = md.use_normal
949 sub.prop(md, "use_normal_x", text="X")
950 sub.prop(md, "use_normal_y", text="Y")
951 sub.prop(md, "use_normal_z", text="Z")
953 split = layout.split()
956 col.label(text="Time:")
957 sub = col.column(align=True)
958 sub.prop(md, "time_offset", text="Offset")
959 sub.prop(md, "lifetime", text="Life")
960 col.prop(md, "damping_time", text="Damping")
963 col.label(text="Position:")
964 sub = col.column(align=True)
965 sub.prop(md, "start_position_x", text="X")
966 sub.prop(md, "start_position_y", text="Y")
967 col.prop(md, "falloff_radius", text="Falloff")
971 layout.prop(md, "start_position_object")
972 layout.prop_search(md, "vertex_group", ob, "vertex_groups")
973 split = layout.split(percentage=0.33)
975 col.label(text="Texture")
977 col.template_ID(md, "texture", new="texture.new")
978 layout.prop(md, "texture_coords")
979 if md.texture_coords == 'UV' and ob.type == 'MESH':
980 layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
981 elif md.texture_coords == 'OBJECT':
982 layout.prop(md, "texture_coords_object")
986 split = layout.split()
989 col.prop(md, "speed", slider=True)
990 col.prop(md, "height", slider=True)
993 col.prop(md, "width", slider=True)
994 col.prop(md, "narrowness", slider=True)
996 def REMESH(self, layout, ob, md):
997 layout.prop(md, "mode")
1000 row.prop(md, "octree_depth")
1001 row.prop(md, "scale")
1003 if md.mode == 'SHARP':
1004 layout.prop(md, "sharpness")
1006 layout.prop(md, "use_smooth_shade")
1007 layout.prop(md, "use_remove_disconnected")
1009 row.active = md.use_remove_disconnected
1010 row.prop(md, "threshold")
1013 def vertex_weight_mask(layout, ob, md):
1014 layout.label(text="Influence/Mask Options:")
1016 split = layout.split(percentage=0.4)
1017 split.label(text="Global Influence:")
1018 split.prop(md, "mask_constant", text="")
1020 if not md.mask_texture:
1021 split = layout.split(percentage=0.4)
1022 split.label(text="Vertex Group Mask:")
1023 split.prop_search(md, "mask_vertex_group", ob, "vertex_groups", text="")
1025 if not md.mask_vertex_group:
1026 split = layout.split(percentage=0.4)
1027 split.label(text="Texture Mask:")
1028 split.template_ID(md, "mask_texture", new="texture.new")
1030 split = layout.split()
1032 col = split.column()
1033 col.label(text="Texture Coordinates:")
1034 col.prop(md, "mask_tex_mapping", text="")
1036 col = split.column()
1037 col.label(text="Use Channel:")
1038 col.prop(md, "mask_tex_use_channel", text="")
1040 if md.mask_tex_mapping == 'OBJECT':
1041 layout.prop(md, "mask_tex_map_object", text="Object")
1042 elif md.mask_tex_mapping == 'UV' and ob.type == 'MESH':
1043 layout.prop_search(md, "mask_tex_uv_layer", ob.data, "uv_textures")
1045 def VERTEX_WEIGHT_EDIT(self, layout, ob, md):
1046 split = layout.split()
1048 col = split.column()
1049 col.label(text="Vertex Group:")
1050 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1052 col.label(text="Default Weight:")
1053 col.prop(md, "default_weight", text="")
1055 col = split.column()
1056 col.prop(md, "use_add")
1058 sub.active = md.use_add
1059 sub.prop(md, "add_threshold")
1062 col.prop(md, "use_remove")
1064 sub.active = md.use_remove
1065 sub.prop(md, "remove_threshold")
1069 layout.prop(md, "falloff_type")
1070 if md.falloff_type == 'CURVE':
1071 layout.template_curve_mapping(md, "map_curve")
1073 # Common mask options
1075 self.vertex_weight_mask(layout, ob, md)
1077 def VERTEX_WEIGHT_MIX(self, layout, ob, md):
1078 split = layout.split()
1080 col = split.column()
1081 col.label(text="Vertex Group A:")
1082 col.prop_search(md, "vertex_group_a", ob, "vertex_groups", text="")
1083 col.label(text="Default Weight A:")
1084 col.prop(md, "default_weight_a", text="")
1086 col.label(text="Mix Mode:")
1087 col.prop(md, "mix_mode", text="")
1089 col = split.column()
1090 col.label(text="Vertex Group B:")
1091 col.prop_search(md, "vertex_group_b", ob, "vertex_groups", text="")
1092 col.label(text="Default Weight B:")
1093 col.prop(md, "default_weight_b", text="")
1095 col.label(text="Mix Set:")
1096 col.prop(md, "mix_set", text="")
1098 # Common mask options
1100 self.vertex_weight_mask(layout, ob, md)
1102 def VERTEX_WEIGHT_PROXIMITY(self, layout, ob, md):
1103 split = layout.split()
1105 col = split.column()
1106 col.label(text="Vertex Group:")
1107 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1109 col = split.column()
1110 col.label(text="Target Object:")
1111 col.prop(md, "target", text="")
1113 split = layout.split()
1115 col = split.column()
1116 col.label(text="Distance:")
1117 col.prop(md, "proximity_mode", text="")
1118 if md.proximity_mode == 'GEOMETRY':
1119 col.row().prop(md, "proximity_geometry")
1121 col = split.column()
1123 col.prop(md, "min_dist")
1124 col.prop(md, "max_dist")
1127 layout.prop(md, "falloff_type")
1129 # Common mask options
1131 self.vertex_weight_mask(layout, ob, md)
1133 def SKIN(self, layout, ob, md):
1135 row.operator("object.skin_armature_create", text="Create Armature")
1136 row.operator("mesh.customdata_skin_add")
1140 row = layout.row(align=True)
1141 row.prop(md, "branch_smoothing")
1142 row.prop(md, "use_smooth_shade")
1144 split = layout.split()
1146 col = split.column()
1147 col.label(text="Selected Vertices:")
1148 sub = col.column(align=True)
1149 sub.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK'
1150 sub.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR'
1153 sub.operator("object.skin_root_mark", text="Mark Root")
1154 sub.operator("object.skin_radii_equalize", text="Equalize Radii")
1156 col = split.column()
1157 col.label(text="Symmetry Axes:")
1158 col.prop(md, "use_x_symmetry")
1159 col.prop(md, "use_y_symmetry")
1160 col.prop(md, "use_z_symmetry")
1162 def TRIANGULATE(self, layout, ob, md):
1166 col.label(text="Quad Method:")
1167 col.prop(md, "quad_method", text="")
1169 col.label(text="Ngon Method:")
1170 col.prop(md, "ngon_method", text="")
1172 def UV_WARP(self, layout, ob, md):
1173 split = layout.split()
1174 col = split.column()
1175 col.prop(md, "center")
1177 col = split.column()
1178 col.label(text="UV Axis:")
1179 col.prop(md, "axis_u", text="")
1180 col.prop(md, "axis_v", text="")
1182 split = layout.split()
1183 col = split.column()
1184 col.label(text="From:")
1185 col.prop(md, "object_from", text="")
1187 col = split.column()
1188 col.label(text="To:")
1189 col.prop(md, "object_to", text="")
1191 split = layout.split()
1192 col = split.column()
1193 obj = md.object_from
1194 if obj and obj.type == 'ARMATURE':
1195 col.label(text="Bone:")
1196 col.prop_search(md, "bone_from", obj.data, "bones", text="")
1198 col = split.column()
1200 if obj and obj.type == 'ARMATURE':
1201 col.label(text="Bone:")
1202 col.prop_search(md, "bone_to", obj.data, "bones", text="")
1204 split = layout.split()
1206 col = split.column()
1207 col.label(text="Vertex Group:")
1208 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1210 col = split.column()
1211 col.label(text="UV Map:")
1212 col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
1214 def WIREFRAME(self, layout, ob, md):
1215 has_vgroup = bool(md.vertex_group)
1217 split = layout.split()
1219 col = split.column()
1220 col.prop(md, "thickness", text="Thickness")
1222 row = col.row(align=True)
1223 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1224 sub = row.row(align=True)
1225 sub.active = has_vgroup
1226 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1227 row = col.row(align=True)
1228 row.active = has_vgroup
1229 row.prop(md, "thickness_vertex_group", text="Factor")
1231 col.prop(md, "use_crease", text="Crease Edges")
1232 col.prop(md, "crease_weight", text="Crease Weight")
1234 col = split.column()
1236 col.prop(md, "offset")
1237 col.prop(md, "use_even_offset", text="Even Thickness")
1238 col.prop(md, "use_relative_offset", text="Relative Thickness")
1239 col.prop(md, "use_boundary", text="Boundary")
1240 col.prop(md, "use_replace", text="Replace Original")
1242 col.prop(md, "material_offset", text="Material Offset")
1244 def DATA_TRANSFER(self, layout, ob, md):
1245 row = layout.row(align=True)
1246 row.prop(md, "object")
1247 sub = row.row(align=True)
1248 sub.active = bool(md.object)
1249 sub.prop(md, "use_object_transform", text="", icon='GROUP')
1253 split = layout.split(0.333)
1254 split.prop(md, "use_vert_data")
1255 use_vert = md.use_vert_data
1257 row.active = use_vert
1258 row.prop(md, "vert_mapping", text="")
1260 col = layout.column(align=True)
1261 split = col.split(0.333, align=True)
1262 sub = split.column(align=True)
1263 sub.prop(md, "data_types_verts")
1264 sub = split.column(align=True)
1265 row = sub.row(align=True)
1266 row.prop(md, "layers_vgroup_select_src", text="")
1267 row.label(icon='RIGHTARROW')
1268 row.prop(md, "layers_vgroup_select_dst", text="")
1269 row = sub.row(align=True)
1270 row.label("", icon='NONE')
1274 split = layout.split(0.333)
1275 split.prop(md, "use_edge_data")
1276 use_edge = md.use_edge_data
1278 row.active = use_edge
1279 row.prop(md, "edge_mapping", text="")
1281 col = layout.column(align=True)
1282 split = col.split(0.333, align=True)
1283 sub = split.column(align=True)
1284 sub.prop(md, "data_types_edges")
1288 split = layout.split(0.333)
1289 split.prop(md, "use_loop_data")
1290 use_loop = md.use_loop_data
1292 row.active = use_loop
1293 row.prop(md, "loop_mapping", text="")
1295 col = layout.column(align=True)
1296 split = col.split(0.333, align=True)
1297 sub = split.column(align=True)
1298 sub.prop(md, "data_types_loops")
1299 sub = split.column(align=True)
1300 row = sub.row(align=True)
1301 row.label("", icon='NONE')
1302 row = sub.row(align=True)
1303 row.prop(md, "layers_vcol_select_src", text="")
1304 row.label(icon='RIGHTARROW')
1305 row.prop(md, "layers_vcol_select_dst", text="")
1306 row = sub.row(align=True)
1307 row.prop(md, "layers_uv_select_src", text="")
1308 row.label(icon='RIGHTARROW')
1309 row.prop(md, "layers_uv_select_dst", text="")
1310 col.prop(md, "islands_precision")
1314 split = layout.split(0.333)
1315 split.prop(md, "use_poly_data")
1316 use_poly = md.use_poly_data
1318 row.active = use_poly
1319 row.prop(md, "poly_mapping", text="")
1321 col = layout.column(align=True)
1322 split = col.split(0.333, align=True)
1323 sub = split.column(align=True)
1324 sub.prop(md, "data_types_polys")
1328 split = layout.split()
1329 col = split.column()
1330 row = col.row(align=True)
1331 sub = row.row(align=True)
1332 sub.active = md.use_max_distance
1333 sub.prop(md, "max_distance")
1334 row.prop(md, "use_max_distance", text="", icon='STYLUS_PRESSURE')
1336 col = split.column()
1337 col.prop(md, "ray_radius")
1341 split = layout.split()
1342 col = split.column()
1343 col.prop(md, "mix_mode")
1344 col.prop(md, "mix_factor")
1346 col = split.column()
1348 row.active = bool(md.object)
1349 row.operator("object.datalayout_transfer", text="Generate Data Layers")
1350 row = col.row(align=True)
1351 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1352 sub = row.row(align=True)
1353 sub.active = bool(md.vertex_group)
1354 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1356 def NORMAL_EDIT(self, layout, ob, md):
1357 has_vgroup = bool(md.vertex_group)
1358 needs_object_offset = (((md.mode == 'RADIAL') and not md.target) or
1359 ((md.mode == 'DIRECTIONAL') and md.use_direction_parallel))
1362 row.prop(md, "mode", expand=True)
1364 split = layout.split()
1366 col = split.column()
1367 col.prop(md, "target", text="")
1368 sub = col.column(align=True)
1369 sub.active = needs_object_offset
1370 sub.prop(md, "offset")
1371 row = col.row(align=True)
1373 col = split.column()
1375 row.active = (md.mode == 'DIRECTIONAL')
1376 row.prop(md, "use_direction_parallel")
1378 subcol = col.column(align=True)
1379 subcol.label("Mix Mode:")
1380 subcol.prop(md, "mix_mode", text="")
1381 subcol.prop(md, "mix_factor")
1382 row = subcol.row(align=True)
1383 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1384 sub = row.row(align=True)
1385 sub.active = has_vgroup
1386 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1387 subcol.prop(md, "mix_limit")
1389 def CORRECTIVE_SMOOTH(self, layout, ob, md):
1390 is_bind = md.is_bind
1392 layout.prop(md, "factor", text="Factor")
1393 layout.prop(md, "iterations")
1396 row.prop(md, "smooth_type")
1398 split = layout.split()
1400 col = split.column()
1401 col.label(text="Vertex Group:")
1402 row = col.row(align=True)
1403 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1404 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1406 col = split.column()
1407 col.prop(md, "use_only_smooth")
1408 col.prop(md, "use_pin_boundary")
1410 layout.prop(md, "rest_source")
1411 if md.rest_source == 'BIND':
1412 layout.operator("object.correctivesmooth_bind", text="Unbind" if is_bind else "Bind")
1415 if __name__ == "__main__": # only for live edit.
1416 bpy.utils.register_module(__name__)