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="")
159 split = layout.split()
160 split.column().label(text="Solver:")
161 split.column().prop(md, "solver", text="")
163 if md.solver == 'BMESH':
164 layout.prop(md, "double_threshold")
166 def BUILD(self, layout, ob, md):
167 split = layout.split()
170 col.prop(md, "frame_start")
171 col.prop(md, "frame_duration")
172 col.prop(md, "use_reverse")
175 col.prop(md, "use_random_order")
177 sub.active = md.use_random_order
180 def MESH_CACHE(self, layout, ob, md):
181 layout.prop(md, "cache_format")
182 layout.prop(md, "filepath")
184 if md.cache_format == 'ABC':
185 layout.prop(md, "sub_object")
187 layout.label(text="Evaluation:")
188 layout.prop(md, "factor", slider=True)
189 layout.prop(md, "deform_mode")
190 layout.prop(md, "interpolation")
192 layout.label(text="Time Mapping:")
195 row.prop(md, "time_mode", expand=True)
197 row.prop(md, "play_mode", expand=True)
198 if md.play_mode == 'SCENE':
199 layout.prop(md, "frame_start")
200 layout.prop(md, "frame_scale")
202 time_mode = md.time_mode
203 if time_mode == 'FRAME':
204 layout.prop(md, "eval_frame")
205 elif time_mode == 'TIME':
206 layout.prop(md, "eval_time")
207 elif time_mode == 'FACTOR':
208 layout.prop(md, "eval_factor")
210 layout.label(text="Axis Mapping:")
211 split = layout.split(percentage=0.5, align=True)
212 split.alert = (md.forward_axis[-1] == md.up_axis[-1])
213 split.label("Forward/Up Axis:")
214 split.prop(md, "forward_axis", text="")
215 split.prop(md, "up_axis", text="")
216 split = layout.split(percentage=0.5)
217 split.label(text="Flip Axis:")
219 row.prop(md, "flip_axis")
221 def MESH_SEQUENCE_CACHE(self, layout, ob, md):
222 layout.label(text="Cache File Properties:")
224 box.template_cache_file(md, "cache_file")
226 cache_file = md.cache_file
228 layout.label(text="Modifier Properties:")
231 if cache_file is not None:
232 box.prop_search(md, "object_path", cache_file, "object_paths")
234 if ob.type == 'MESH':
235 box.row().prop(md, "read_data")
237 def CAST(self, layout, ob, md):
238 split = layout.split(percentage=0.25)
240 split.label(text="Cast Type:")
241 split.prop(md, "cast_type", text="")
243 split = layout.split(percentage=0.25)
246 col.prop(md, "use_x")
247 col.prop(md, "use_y")
248 col.prop(md, "use_z")
251 col.prop(md, "factor")
252 col.prop(md, "radius")
254 col.prop(md, "use_radius_as_size")
256 split = layout.split()
259 col.label(text="Vertex Group:")
260 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
262 col.label(text="Control Object:")
263 col.prop(md, "object", text="")
265 col.prop(md, "use_transform")
267 def CLOTH(self, layout, ob, md):
268 layout.label(text="Settings are inside the Physics tab")
270 def COLLISION(self, layout, ob, md):
271 layout.label(text="Settings are inside the Physics tab")
273 def CURVE(self, layout, ob, md):
274 split = layout.split()
277 col.label(text="Object:")
278 col.prop(md, "object", text="")
280 col.label(text="Vertex Group:")
281 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
282 layout.label(text="Deformation Axis:")
283 layout.row().prop(md, "deform_axis", expand=True)
285 def DECIMATE(self, layout, ob, md):
286 decimate_type = md.decimate_type
289 row.prop(md, "decimate_type", expand=True)
291 if decimate_type == 'COLLAPSE':
292 has_vgroup = bool(md.vertex_group)
293 layout.prop(md, "ratio")
295 split = layout.split()
298 row = col.row(align=True)
299 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
300 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
306 row.active = has_vgroup
307 row.prop(md, "vertex_group_factor")
309 col.prop(md, "use_collapse_triangulate")
310 row = col.split(percentage=0.75)
311 row.prop(md, "use_symmetry")
312 row.prop(md, "symmetry_axis", text="")
314 elif decimate_type == 'UNSUBDIV':
315 layout.prop(md, "iterations")
317 else: # decimate_type == 'DISSOLVE':
318 layout.prop(md, "angle_limit")
319 layout.prop(md, "use_dissolve_boundaries")
320 layout.label("Delimit:")
322 row.prop(md, "delimit")
325 layout_info.label(text=iface_("Faces: %d") % md.face_count, translate=False)
327 def DISPLACE(self, layout, ob, md):
328 has_texture = (md.texture is not None)
330 col = layout.column(align=True)
331 col.label(text="Texture:")
332 col.template_ID(md, "texture", new="texture.new")
334 split = layout.split()
336 col = split.column(align=True)
337 col.label(text="Direction:")
338 col.prop(md, "direction", text="")
339 if md.direction in {'X', 'Y', 'Z', 'RGB_TO_XYZ'}:
340 col.label(text="Space:")
341 col.prop(md, "space", text="")
342 col.label(text="Vertex Group:")
343 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
345 col = split.column(align=True)
346 col.active = has_texture
347 col.label(text="Texture Coordinates:")
348 col.prop(md, "texture_coords", text="")
349 if md.texture_coords == 'OBJECT':
350 col.label(text="Object:")
351 col.prop(md, "texture_coords_object", text="")
352 elif md.texture_coords == 'UV' and ob.type == 'MESH':
353 col.label(text="UV Map:")
354 col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
359 row.prop(md, "mid_level")
360 row.prop(md, "strength")
362 def DYNAMIC_PAINT(self, layout, ob, md):
363 layout.label(text="Settings are inside the Physics tab")
365 def EDGE_SPLIT(self, layout, ob, md):
366 split = layout.split()
369 col.prop(md, "use_edge_angle", text="Edge Angle")
371 sub.active = md.use_edge_angle
372 sub.prop(md, "split_angle")
374 split.prop(md, "use_edge_sharp", text="Sharp Edges")
376 def EXPLODE(self, layout, ob, md):
377 split = layout.split()
380 col.label(text="Vertex group:")
381 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
383 sub.active = bool(md.vertex_group)
384 sub.prop(md, "protect")
385 col.label(text="Particle UV")
386 col.prop_search(md, "particle_uv", ob.data, "uv_textures", text="")
389 col.prop(md, "use_edge_cut")
390 col.prop(md, "show_unborn")
391 col.prop(md, "show_alive")
392 col.prop(md, "show_dead")
393 col.prop(md, "use_size")
395 layout.operator("object.explode_refresh", text="Refresh")
397 def FLUID_SIMULATION(self, layout, ob, md):
398 layout.label(text="Settings are inside the Physics tab")
400 def HOOK(self, layout, ob, md):
401 use_falloff = (md.falloff_type != 'NONE')
402 split = layout.split()
405 col.label(text="Object:")
406 col.prop(md, "object", text="")
407 if md.object and md.object.type == 'ARMATURE':
408 col.label(text="Bone:")
409 col.prop_search(md, "subtarget", md.object.data, "bones", text="")
411 col.label(text="Vertex Group:")
412 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
416 row = layout.row(align=True)
418 row.prop(md, "falloff_radius")
419 row.prop(md, "strength", slider=True)
420 layout.prop(md, "falloff_type")
422 col = layout.column()
424 if md.falloff_type == 'CURVE':
425 col.template_curve_mapping(md, "falloff_curve")
427 split = layout.split()
430 col.prop(md, "use_falloff_uniform")
432 if ob.mode == 'EDIT':
433 row = col.row(align=True)
434 row.operator("object.hook_reset", text="Reset")
435 row.operator("object.hook_recenter", text="Recenter")
437 row = layout.row(align=True)
438 row.operator("object.hook_select", text="Select")
439 row.operator("object.hook_assign", text="Assign")
441 def LAPLACIANDEFORM(self, layout, ob, md):
444 layout.prop(md, "iterations")
447 row.active = not is_bind
448 row.label(text="Anchors Vertex Group:")
451 row.enabled = not is_bind
452 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
457 row.enabled = bool(md.vertex_group)
458 row.operator("object.laplaciandeform_bind", text="Unbind" if is_bind else "Bind")
460 def LAPLACIANSMOOTH(self, layout, ob, md):
461 layout.prop(md, "iterations")
463 split = layout.split(percentage=0.25)
466 col.label(text="Axis:")
467 col.prop(md, "use_x")
468 col.prop(md, "use_y")
469 col.prop(md, "use_z")
472 col.label(text="Lambda:")
473 col.prop(md, "lambda_factor", text="Factor")
474 col.prop(md, "lambda_border", text="Border")
477 col.prop(md, "use_volume_preserve")
478 col.prop(md, "use_normalized")
480 layout.label(text="Vertex Group:")
481 layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
483 def LATTICE(self, layout, ob, md):
484 split = layout.split()
487 col.label(text="Object:")
488 col.prop(md, "object", text="")
491 col.label(text="Vertex Group:")
492 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
495 layout.prop(md, "strength", slider=True)
497 def MASK(self, layout, ob, md):
498 split = layout.split()
501 col.label(text="Mode:")
502 col.prop(md, "mode", text="")
505 if md.mode == 'ARMATURE':
506 col.label(text="Armature:")
507 row = col.row(align=True)
508 row.prop(md, "armature", text="")
509 sub = row.row(align=True)
510 sub.active = (md.armature is not None)
511 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
512 elif md.mode == 'VERTEX_GROUP':
513 col.label(text="Vertex Group:")
514 row = col.row(align=True)
515 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
516 sub = row.row(align=True)
517 sub.active = bool(md.vertex_group)
518 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
520 def MESH_DEFORM(self, layout, ob, md):
521 split = layout.split()
524 col.enabled = not md.is_bound
525 col.label(text="Object:")
526 col.prop(md, "object", text="")
529 col.label(text="Vertex Group:")
530 row = col.row(align=True)
531 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
532 sub = row.row(align=True)
533 sub.active = bool(md.vertex_group)
534 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
538 row.enabled = not md.is_bound
539 row.prop(md, "precision")
540 row.prop(md, "use_dynamic_bind")
544 layout.operator("object.meshdeform_bind", text="Unbind")
546 layout.operator("object.meshdeform_bind", text="Bind")
548 def MIRROR(self, layout, ob, md):
549 split = layout.split(percentage=0.25)
552 col.label(text="Axis:")
553 col.prop(md, "use_x")
554 col.prop(md, "use_y")
555 col.prop(md, "use_z")
558 col.label(text="Options:")
559 col.prop(md, "use_mirror_merge", text="Merge")
560 col.prop(md, "use_clip", text="Clipping")
561 col.prop(md, "use_mirror_vertex_groups", text="Vertex Groups")
564 col.label(text="Textures:")
565 col.prop(md, "use_mirror_u", text="U")
566 col.prop(md, "use_mirror_v", text="V")
568 col = layout.column()
570 if md.use_mirror_merge is True:
571 col.prop(md, "merge_threshold")
572 col.label(text="Mirror Object:")
573 col.prop(md, "mirror_object", text="")
575 def MULTIRES(self, layout, ob, md):
576 layout.row().prop(md, "subdivision_type", expand=True)
578 split = layout.split()
580 col.prop(md, "levels", text="Preview")
581 col.prop(md, "sculpt_levels", text="Sculpt")
582 col.prop(md, "render_levels", text="Render")
586 col.enabled = ob.mode != 'EDIT'
587 col.operator("object.multires_subdivide", text="Subdivide")
588 col.operator("object.multires_higher_levels_delete", text="Delete Higher")
589 col.operator("object.multires_reshape", text="Reshape")
590 col.operator("object.multires_base_apply", text="Apply Base")
591 col.prop(md, "use_subsurf_uv")
592 col.prop(md, "show_only_control_edges")
596 col = layout.column()
599 row.operator("object.multires_external_pack", text="Pack External")
602 row.prop(md, "filepath", text="")
604 row.operator("object.multires_external_save", text="Save External...")
607 def OCEAN(self, layout, ob, md):
608 if not bpy.app.build_options.mod_oceansim:
609 layout.label("Built without OceanSim modifier")
612 layout.prop(md, "geometry_mode")
614 if md.geometry_mode == 'GENERATE':
616 row.prop(md, "repeat_x")
617 row.prop(md, "repeat_y")
621 split = layout.split()
625 col.prop(md, "depth")
626 col.prop(md, "random_seed")
629 col.prop(md, "resolution")
631 col.prop(md, "spatial_size")
633 layout.label("Waves:")
635 split = layout.split()
638 col.prop(md, "choppiness")
639 col.prop(md, "wave_scale", text="Scale")
640 col.prop(md, "wave_scale_min")
641 col.prop(md, "wind_velocity")
644 col.prop(md, "wave_alignment", text="Alignment")
646 sub.active = (md.wave_alignment > 0.0)
647 sub.prop(md, "wave_direction", text="Direction")
648 sub.prop(md, "damping")
652 layout.prop(md, "use_normals")
654 split = layout.split()
657 col.prop(md, "use_foam")
659 sub.active = md.use_foam
660 sub.prop(md, "foam_coverage", text="Coverage")
663 col.active = md.use_foam
664 col.label("Foam Data Layer Name:")
665 col.prop(md, "foam_layer_name", text="")
670 layout.operator("object.ocean_bake", text="Free Bake").free = True
672 layout.operator("object.ocean_bake").free = False
674 split = layout.split()
675 split.enabled = not md.is_cached
677 col = split.column(align=True)
678 col.prop(md, "frame_start", text="Start")
679 col.prop(md, "frame_end", text="End")
681 col = split.column(align=True)
682 col.label(text="Cache path:")
683 col.prop(md, "filepath", text="")
685 split = layout.split()
686 split.enabled = not md.is_cached
689 col.active = md.use_foam
690 col.prop(md, "bake_foam_fade")
694 def SCREW(self, layout, ob, md):
695 split = layout.split()
699 col.prop(md, "object", text="AxisOb")
700 col.prop(md, "angle")
701 col.prop(md, "steps")
702 col.prop(md, "render_steps")
703 col.prop(md, "use_smooth_shade")
707 row.active = (md.object is None or md.use_object_screw_offset is False)
708 row.prop(md, "screw_offset")
710 row.active = (md.object is not None)
711 row.prop(md, "use_object_screw_offset")
712 col.prop(md, "use_normal_calculate")
713 col.prop(md, "use_normal_flip")
714 col.prop(md, "iterations")
715 col.prop(md, "use_stretch_u")
716 col.prop(md, "use_stretch_v")
718 def SHRINKWRAP(self, layout, ob, md):
719 split = layout.split()
721 col.label(text="Target:")
722 col.prop(md, "target", text="")
724 col.label(text="Vertex Group:")
725 row = col.row(align=True)
726 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
727 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
729 split = layout.split()
732 col.prop(md, "offset")
735 col.label(text="Mode:")
736 col.prop(md, "wrap_method", text="")
738 if md.wrap_method == 'PROJECT':
739 split = layout.split()
741 col.prop(md, "subsurf_levels")
744 col.prop(md, "project_limit", text="Limit")
745 split = layout.split(percentage=0.25)
748 col.label(text="Axis:")
749 col.prop(md, "use_project_x")
750 col.prop(md, "use_project_y")
751 col.prop(md, "use_project_z")
754 col.label(text="Direction:")
755 col.prop(md, "use_negative_direction")
756 col.prop(md, "use_positive_direction")
759 col.label(text="Cull Faces:")
760 col.prop(md, "cull_face", expand=True)
762 layout.prop(md, "auxiliary_target")
764 elif md.wrap_method == 'NEAREST_SURFACEPOINT':
765 layout.prop(md, "use_keep_above_surface")
767 def SIMPLE_DEFORM(self, layout, ob, md):
769 layout.row().prop(md, "deform_method", expand=True)
771 split = layout.split()
774 col.label(text="Vertex Group:")
775 row = col.row(align=True)
776 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
777 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
779 split = layout.split()
782 col.label(text="Axis, Origin:")
783 col.prop(md, "origin", text="")
785 if md.deform_method in {'TAPER', 'STRETCH', 'TWIST'}:
786 col.label(text="Lock:")
787 col.prop(md, "lock_x")
788 col.prop(md, "lock_y")
791 col.label(text="Deform:")
792 if md.deform_method in {'TAPER', 'STRETCH'}:
793 col.prop(md, "factor")
795 col.prop(md, "angle")
796 col.prop(md, "limits", slider=True)
798 def SMOKE(self, layout, ob, md):
799 layout.label(text="Settings are inside the Physics tab")
801 def SMOOTH(self, layout, ob, md):
802 split = layout.split(percentage=0.25)
805 col.label(text="Axis:")
806 col.prop(md, "use_x")
807 col.prop(md, "use_y")
808 col.prop(md, "use_z")
811 col.prop(md, "factor")
812 col.prop(md, "iterations")
813 col.label(text="Vertex Group:")
814 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
816 def SOFT_BODY(self, layout, ob, md):
817 layout.label(text="Settings are inside the Physics tab")
819 def SOLIDIFY(self, layout, ob, md):
820 split = layout.split()
823 col.prop(md, "thickness")
824 col.prop(md, "thickness_clamp")
828 row = col.row(align=True)
829 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
830 sub = row.row(align=True)
831 sub.active = bool(md.vertex_group)
832 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
835 sub.active = bool(md.vertex_group)
836 sub.prop(md, "thickness_vertex_group", text="Factor")
838 col.label(text="Crease:")
839 col.prop(md, "edge_crease_inner", text="Inner")
840 col.prop(md, "edge_crease_outer", text="Outer")
841 col.prop(md, "edge_crease_rim", text="Rim")
845 col.prop(md, "offset")
846 col.prop(md, "use_flip_normals")
848 col.prop(md, "use_even_offset")
849 col.prop(md, "use_quality_normals")
850 col.prop(md, "use_rim")
851 col_rim = col.column()
852 col_rim.active = md.use_rim
853 col_rim.prop(md, "use_rim_only")
857 col.label(text="Material Index Offset:")
860 row = sub.split(align=True, percentage=0.4)
861 row.prop(md, "material_offset", text="")
862 row = row.row(align=True)
863 row.active = md.use_rim
864 row.prop(md, "material_offset_rim", text="Rim")
866 def SUBSURF(self, layout, ob, md):
867 layout.row().prop(md, "subdivision_type", expand=True)
869 split = layout.split()
872 scene = bpy.context.scene
873 engine = scene.render.engine
874 show_adaptive_options = (engine == "CYCLES" and md == ob.modifiers[-1] and
875 scene.cycles.feature_set == "EXPERIMENTAL")
877 if show_adaptive_options:
878 col.label(text="View:")
879 col.prop(md, "levels", text="Levels")
880 col.label(text="Render:")
881 col.prop(ob.cycles, "use_adaptive_subdivision", text="Adaptive")
882 if ob.cycles.use_adaptive_subdivision:
883 col.prop(ob.cycles, "dicing_rate")
885 col.prop(md, "render_levels", text="Levels")
887 col.label(text="Subdivisions:")
888 col.prop(md, "levels", text="View")
889 col.prop(md, "render_levels", text="Render")
892 col.label(text="Options:")
895 sub.active = (not show_adaptive_options) or (not ob.cycles.use_adaptive_subdivision)
896 sub.prop(md, "use_subsurf_uv")
898 col.prop(md, "show_only_control_edges")
899 if hasattr(md, "use_opensubdiv"):
900 col.prop(md, "use_opensubdiv")
902 if show_adaptive_options and ob.cycles.use_adaptive_subdivision:
903 col = layout.column(align=True)
906 col.label("Final Dicing Rate:")
909 render = max(scene.cycles.dicing_rate * ob.cycles.dicing_rate, 0.1)
910 preview = max(scene.cycles.preview_dicing_rate * ob.cycles.dicing_rate, 0.1)
911 col.label("Render %.2f px, Preview %.2f px" % (render, preview))
913 def SURFACE(self, layout, ob, md):
914 layout.label(text="Settings are inside the Physics tab")
916 def UV_PROJECT(self, layout, ob, md):
917 split = layout.split()
920 col.label(text="Image:")
921 col.prop(md, "image", text="")
924 col.label(text="UV Map:")
925 col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
927 split = layout.split()
929 col.prop(md, "use_image_override")
930 col.prop(md, "projector_count", text="Projectors")
931 for proj in md.projectors:
932 col.prop(proj, "object", text="")
935 sub = col.column(align=True)
936 sub.prop(md, "aspect_x", text="Aspect X")
937 sub.prop(md, "aspect_y", text="Aspect Y")
939 sub = col.column(align=True)
940 sub.prop(md, "scale_x", text="Scale X")
941 sub.prop(md, "scale_y", text="Scale Y")
943 def WARP(self, layout, ob, md):
944 use_falloff = (md.falloff_type != 'NONE')
945 split = layout.split()
948 col.label(text="From:")
949 col.prop(md, "object_from", text="")
951 col.prop(md, "use_volume_preserve")
954 col.label(text="To:")
955 col.prop(md, "object_to", text="")
956 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
958 col = layout.column()
960 row = col.row(align=True)
961 row.prop(md, "strength")
963 row.prop(md, "falloff_radius")
965 col.prop(md, "falloff_type")
967 if md.falloff_type == 'CURVE':
968 col.template_curve_mapping(md, "falloff_curve")
971 split = layout.split()
973 col.label(text="Texture:")
974 col.template_ID(md, "texture", new="texture.new")
977 col.label(text="Texture Coordinates:")
978 col.prop(md, "texture_coords", text="")
980 if md.texture_coords == 'OBJECT':
981 layout.prop(md, "texture_coords_object", text="Object")
982 elif md.texture_coords == 'UV' and ob.type == 'MESH':
983 layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
985 def WAVE(self, layout, ob, md):
986 split = layout.split()
989 col.label(text="Motion:")
990 col.prop(md, "use_x")
991 col.prop(md, "use_y")
992 col.prop(md, "use_cyclic")
995 col.prop(md, "use_normal")
997 sub.active = md.use_normal
998 sub.prop(md, "use_normal_x", text="X")
999 sub.prop(md, "use_normal_y", text="Y")
1000 sub.prop(md, "use_normal_z", text="Z")
1002 split = layout.split()
1004 col = split.column()
1005 col.label(text="Time:")
1006 sub = col.column(align=True)
1007 sub.prop(md, "time_offset", text="Offset")
1008 sub.prop(md, "lifetime", text="Life")
1009 col.prop(md, "damping_time", text="Damping")
1011 col = split.column()
1012 col.label(text="Position:")
1013 sub = col.column(align=True)
1014 sub.prop(md, "start_position_x", text="X")
1015 sub.prop(md, "start_position_y", text="Y")
1016 col.prop(md, "falloff_radius", text="Falloff")
1020 layout.prop(md, "start_position_object")
1021 layout.prop_search(md, "vertex_group", ob, "vertex_groups")
1022 split = layout.split(percentage=0.33)
1023 col = split.column()
1024 col.label(text="Texture")
1025 col = split.column()
1026 col.template_ID(md, "texture", new="texture.new")
1027 layout.prop(md, "texture_coords")
1028 if md.texture_coords == 'UV' and ob.type == 'MESH':
1029 layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
1030 elif md.texture_coords == 'OBJECT':
1031 layout.prop(md, "texture_coords_object")
1035 split = layout.split()
1037 col = split.column()
1038 col.prop(md, "speed", slider=True)
1039 col.prop(md, "height", slider=True)
1041 col = split.column()
1042 col.prop(md, "width", slider=True)
1043 col.prop(md, "narrowness", slider=True)
1045 def REMESH(self, layout, ob, md):
1046 layout.prop(md, "mode")
1049 row.prop(md, "octree_depth")
1050 row.prop(md, "scale")
1052 if md.mode == 'SHARP':
1053 layout.prop(md, "sharpness")
1055 layout.prop(md, "use_smooth_shade")
1056 layout.prop(md, "use_remove_disconnected")
1058 row.active = md.use_remove_disconnected
1059 row.prop(md, "threshold")
1062 def vertex_weight_mask(layout, ob, md):
1063 layout.label(text="Influence/Mask Options:")
1065 split = layout.split(percentage=0.4)
1066 split.label(text="Global Influence:")
1067 split.prop(md, "mask_constant", text="")
1069 if not md.mask_texture:
1070 split = layout.split(percentage=0.4)
1071 split.label(text="Vertex Group Mask:")
1072 split.prop_search(md, "mask_vertex_group", ob, "vertex_groups", text="")
1074 if not md.mask_vertex_group:
1075 split = layout.split(percentage=0.4)
1076 split.label(text="Texture Mask:")
1077 split.template_ID(md, "mask_texture", new="texture.new")
1079 split = layout.split()
1081 col = split.column()
1082 col.label(text="Texture Coordinates:")
1083 col.prop(md, "mask_tex_mapping", text="")
1085 col = split.column()
1086 col.label(text="Use Channel:")
1087 col.prop(md, "mask_tex_use_channel", text="")
1089 if md.mask_tex_mapping == 'OBJECT':
1090 layout.prop(md, "mask_tex_map_object", text="Object")
1091 elif md.mask_tex_mapping == 'UV' and ob.type == 'MESH':
1092 layout.prop_search(md, "mask_tex_uv_layer", ob.data, "uv_textures")
1094 def VERTEX_WEIGHT_EDIT(self, layout, ob, md):
1095 split = layout.split()
1097 col = split.column()
1098 col.label(text="Vertex Group:")
1099 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1101 col.label(text="Default Weight:")
1102 col.prop(md, "default_weight", text="")
1104 col = split.column()
1105 col.prop(md, "use_add")
1107 sub.active = md.use_add
1108 sub.prop(md, "add_threshold")
1111 col.prop(md, "use_remove")
1113 sub.active = md.use_remove
1114 sub.prop(md, "remove_threshold")
1118 layout.prop(md, "falloff_type")
1119 if md.falloff_type == 'CURVE':
1120 layout.template_curve_mapping(md, "map_curve")
1122 # Common mask options
1124 self.vertex_weight_mask(layout, ob, md)
1126 def VERTEX_WEIGHT_MIX(self, layout, ob, md):
1127 split = layout.split()
1129 col = split.column()
1130 col.label(text="Vertex Group A:")
1131 col.prop_search(md, "vertex_group_a", ob, "vertex_groups", text="")
1132 col.label(text="Default Weight A:")
1133 col.prop(md, "default_weight_a", text="")
1135 col.label(text="Mix Mode:")
1136 col.prop(md, "mix_mode", text="")
1138 col = split.column()
1139 col.label(text="Vertex Group B:")
1140 col.prop_search(md, "vertex_group_b", ob, "vertex_groups", text="")
1141 col.label(text="Default Weight B:")
1142 col.prop(md, "default_weight_b", text="")
1144 col.label(text="Mix Set:")
1145 col.prop(md, "mix_set", text="")
1147 # Common mask options
1149 self.vertex_weight_mask(layout, ob, md)
1151 def VERTEX_WEIGHT_PROXIMITY(self, layout, ob, md):
1152 split = layout.split()
1154 col = split.column()
1155 col.label(text="Vertex Group:")
1156 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1158 col = split.column()
1159 col.label(text="Target Object:")
1160 col.prop(md, "target", text="")
1162 split = layout.split()
1164 col = split.column()
1165 col.label(text="Distance:")
1166 col.prop(md, "proximity_mode", text="")
1167 if md.proximity_mode == 'GEOMETRY':
1168 col.row().prop(md, "proximity_geometry")
1170 col = split.column()
1172 col.prop(md, "min_dist")
1173 col.prop(md, "max_dist")
1176 layout.prop(md, "falloff_type")
1178 # Common mask options
1180 self.vertex_weight_mask(layout, ob, md)
1182 def SKIN(self, layout, ob, md):
1184 row.operator("object.skin_armature_create", text="Create Armature")
1185 row.operator("mesh.customdata_skin_add")
1189 row = layout.row(align=True)
1190 row.prop(md, "branch_smoothing")
1191 row.prop(md, "use_smooth_shade")
1193 split = layout.split()
1195 col = split.column()
1196 col.label(text="Selected Vertices:")
1197 sub = col.column(align=True)
1198 sub.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK'
1199 sub.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR'
1202 sub.operator("object.skin_root_mark", text="Mark Root")
1203 sub.operator("object.skin_radii_equalize", text="Equalize Radii")
1205 col = split.column()
1206 col.label(text="Symmetry Axes:")
1207 col.prop(md, "use_x_symmetry")
1208 col.prop(md, "use_y_symmetry")
1209 col.prop(md, "use_z_symmetry")
1211 def TRIANGULATE(self, layout, ob, md):
1215 col.label(text="Quad Method:")
1216 col.prop(md, "quad_method", text="")
1218 col.label(text="Ngon Method:")
1219 col.prop(md, "ngon_method", text="")
1221 def UV_WARP(self, layout, ob, md):
1222 split = layout.split()
1223 col = split.column()
1224 col.prop(md, "center")
1226 col = split.column()
1227 col.label(text="UV Axis:")
1228 col.prop(md, "axis_u", text="")
1229 col.prop(md, "axis_v", text="")
1231 split = layout.split()
1232 col = split.column()
1233 col.label(text="From:")
1234 col.prop(md, "object_from", text="")
1236 col = split.column()
1237 col.label(text="To:")
1238 col.prop(md, "object_to", text="")
1240 split = layout.split()
1241 col = split.column()
1242 obj = md.object_from
1243 if obj and obj.type == 'ARMATURE':
1244 col.label(text="Bone:")
1245 col.prop_search(md, "bone_from", obj.data, "bones", text="")
1247 col = split.column()
1249 if obj and obj.type == 'ARMATURE':
1250 col.label(text="Bone:")
1251 col.prop_search(md, "bone_to", obj.data, "bones", text="")
1253 split = layout.split()
1255 col = split.column()
1256 col.label(text="Vertex Group:")
1257 col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1259 col = split.column()
1260 col.label(text="UV Map:")
1261 col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
1263 def WIREFRAME(self, layout, ob, md):
1264 has_vgroup = bool(md.vertex_group)
1266 split = layout.split()
1268 col = split.column()
1269 col.prop(md, "thickness", text="Thickness")
1271 row = col.row(align=True)
1272 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1273 sub = row.row(align=True)
1274 sub.active = has_vgroup
1275 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1276 row = col.row(align=True)
1277 row.active = has_vgroup
1278 row.prop(md, "thickness_vertex_group", text="Factor")
1280 col.prop(md, "use_crease", text="Crease Edges")
1281 col.prop(md, "crease_weight", text="Crease Weight")
1283 col = split.column()
1285 col.prop(md, "offset")
1286 col.prop(md, "use_even_offset", text="Even Thickness")
1287 col.prop(md, "use_relative_offset", text="Relative Thickness")
1288 col.prop(md, "use_boundary", text="Boundary")
1289 col.prop(md, "use_replace", text="Replace Original")
1291 col.prop(md, "material_offset", text="Material Offset")
1293 def DATA_TRANSFER(self, layout, ob, md):
1294 row = layout.row(align=True)
1295 row.prop(md, "object")
1296 sub = row.row(align=True)
1297 sub.active = bool(md.object)
1298 sub.prop(md, "use_object_transform", text="", icon='GROUP')
1302 split = layout.split(0.333)
1303 split.prop(md, "use_vert_data")
1304 use_vert = md.use_vert_data
1306 row.active = use_vert
1307 row.prop(md, "vert_mapping", text="")
1309 col = layout.column(align=True)
1310 split = col.split(0.333, align=True)
1311 sub = split.column(align=True)
1312 sub.prop(md, "data_types_verts")
1313 sub = split.column(align=True)
1314 row = sub.row(align=True)
1315 row.prop(md, "layers_vgroup_select_src", text="")
1316 row.label(icon='RIGHTARROW')
1317 row.prop(md, "layers_vgroup_select_dst", text="")
1318 row = sub.row(align=True)
1319 row.label("", icon='NONE')
1323 split = layout.split(0.333)
1324 split.prop(md, "use_edge_data")
1325 use_edge = md.use_edge_data
1327 row.active = use_edge
1328 row.prop(md, "edge_mapping", text="")
1330 col = layout.column(align=True)
1331 split = col.split(0.333, align=True)
1332 sub = split.column(align=True)
1333 sub.prop(md, "data_types_edges")
1337 split = layout.split(0.333)
1338 split.prop(md, "use_loop_data")
1339 use_loop = md.use_loop_data
1341 row.active = use_loop
1342 row.prop(md, "loop_mapping", text="")
1344 col = layout.column(align=True)
1345 split = col.split(0.333, align=True)
1346 sub = split.column(align=True)
1347 sub.prop(md, "data_types_loops")
1348 sub = split.column(align=True)
1349 row = sub.row(align=True)
1350 row.label("", icon='NONE')
1351 row = sub.row(align=True)
1352 row.prop(md, "layers_vcol_select_src", text="")
1353 row.label(icon='RIGHTARROW')
1354 row.prop(md, "layers_vcol_select_dst", text="")
1355 row = sub.row(align=True)
1356 row.prop(md, "layers_uv_select_src", text="")
1357 row.label(icon='RIGHTARROW')
1358 row.prop(md, "layers_uv_select_dst", text="")
1359 col.prop(md, "islands_precision")
1363 split = layout.split(0.333)
1364 split.prop(md, "use_poly_data")
1365 use_poly = md.use_poly_data
1367 row.active = use_poly
1368 row.prop(md, "poly_mapping", text="")
1370 col = layout.column(align=True)
1371 split = col.split(0.333, align=True)
1372 sub = split.column(align=True)
1373 sub.prop(md, "data_types_polys")
1377 split = layout.split()
1378 col = split.column()
1379 row = col.row(align=True)
1380 sub = row.row(align=True)
1381 sub.active = md.use_max_distance
1382 sub.prop(md, "max_distance")
1383 row.prop(md, "use_max_distance", text="", icon='STYLUS_PRESSURE')
1385 col = split.column()
1386 col.prop(md, "ray_radius")
1390 split = layout.split()
1391 col = split.column()
1392 col.prop(md, "mix_mode")
1393 col.prop(md, "mix_factor")
1395 col = split.column()
1397 row.active = bool(md.object)
1398 row.operator("object.datalayout_transfer", text="Generate Data Layers")
1399 row = col.row(align=True)
1400 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1401 sub = row.row(align=True)
1402 sub.active = bool(md.vertex_group)
1403 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1405 def NORMAL_EDIT(self, layout, ob, md):
1406 has_vgroup = bool(md.vertex_group)
1407 needs_object_offset = (((md.mode == 'RADIAL') and not md.target) or
1408 ((md.mode == 'DIRECTIONAL') and md.use_direction_parallel))
1411 row.prop(md, "mode", expand=True)
1413 split = layout.split()
1415 col = split.column()
1416 col.prop(md, "target", text="")
1417 sub = col.column(align=True)
1418 sub.active = needs_object_offset
1419 sub.prop(md, "offset")
1420 row = col.row(align=True)
1422 col = split.column()
1424 row.active = (md.mode == 'DIRECTIONAL')
1425 row.prop(md, "use_direction_parallel")
1427 subcol = col.column(align=True)
1428 subcol.label("Mix Mode:")
1429 subcol.prop(md, "mix_mode", text="")
1430 subcol.prop(md, "mix_factor")
1431 row = subcol.row(align=True)
1432 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1433 sub = row.row(align=True)
1434 sub.active = has_vgroup
1435 sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1436 subcol.prop(md, "mix_limit")
1438 def CORRECTIVE_SMOOTH(self, layout, ob, md):
1439 is_bind = md.is_bind
1441 layout.prop(md, "factor", text="Factor")
1442 layout.prop(md, "iterations")
1445 row.prop(md, "smooth_type")
1447 split = layout.split()
1449 col = split.column()
1450 col.label(text="Vertex Group:")
1451 row = col.row(align=True)
1452 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
1453 row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
1455 col = split.column()
1456 col.prop(md, "use_only_smooth")
1457 col.prop(md, "use_pin_boundary")
1459 layout.prop(md, "rest_source")
1460 if md.rest_source == 'BIND':
1461 layout.operator("object.correctivesmooth_bind", text="Unbind" if is_bind else "Bind")
1464 if __name__ == "__main__": # only for live edit.
1465 bpy.utils.register_module(__name__)