From 1e2e08085319712183aa8171c003c851f7707ce1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 25 Jul 2011 15:27:01 +0000 Subject: =?UTF-8?q?Adding=20WeightVG=20modifiers=20code.=20Still=20some=20?= =?UTF-8?q?points=20to=20tweak,=20though.=20NOTE=C2=A0:=20Haven=E2=80=99t?= =?UTF-8?q?=20yet=20tested=20build=20with=20scons,=20will=20do=20asap=20(u?= =?UTF-8?q?nless=20someone=20else=20does=20:)=20).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- release/datafiles/blenderbuttons | Bin 210335 -> 211021 bytes .../startup/bl_ui/properties_data_modifier.py | 129 +++++++++++++++++++++ 2 files changed, 129 insertions(+) (limited to 'release') diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons index 9872e53585e..609a4d55ebc 100644 Binary files a/release/datafiles/blenderbuttons and b/release/datafiles/blenderbuttons differ diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index ce6d0990f05..18ae7ec2be6 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -735,5 +735,134 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): col.prop(md, "width", slider=True) col.prop(md, "narrowness", slider=True) + @staticmethod + def weight_vg_mask(layout, ob, md): + layout.label(text="Influence/Mask Options:") + split = layout.split() + col1 = split.column() + col2 = split.column() + + col1.label(text="Global Influence:") + col2.prop(md, "mask_constant", text="") + + if not md.mask_texture: + col1.label(text="Vertex Group Mask:") + col2.prop_search(md, "mask_vertex_group", ob, "vertex_groups", text="") + + if not md.mask_vertex_group: + col1.label(text="Texture Mask:") + col2.template_ID(md, "mask_texture", new="texture.new") + if md.mask_texture: + split = layout.split() + col = split.column() + col.label(text="Texture Coordinates:") + col.prop(md, "mask_tex_mapping", text="") + col = split.column() + col.label(text="Use Channel:") + col.prop(md, "mask_tex_use_channel", text="") + + if md.mask_tex_mapping == 'OBJECT': + layout.prop(md, "mask_tex_map_obj", text="Object") + elif md.mask_tex_mapping == 'UV' and ob.type == 'MESH': + layout.prop_search(md, "mask_tex_uv_layer", ob.data, "uv_textures") + + def WEIGHT_VGEDIT(self, layout, ob, md): + if ob.type == 'MESH': + split = layout.split() + col = split.column() + col.label(text="Vertex Group:") + col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + + col = split.column() + col.label(text="Default Weight:") + col.prop(md, "default_weight", text="") + + layout.prop(md, "flag_map") + if md.flag_map: + split = layout.split() + col = split.column() + col.label("Input:") + col.label("Output:") + col = split.column() + col.prop(md, "map_input_low", text="Min") + col.prop(md, "map_output_low", text="Min") + col = split.column() + col.prop(md, "map_input_high", text="Max") + col.prop(md, "map_output_high", text="Max") + + layout.prop(md, "flag_curve_map") + if md.flag_curve_map: + row = layout.row() + row.template_curve_mapping(md, "cmap_curve") + + layout.prop(md, "flag_reverse") + + layout.prop(md, "flag_clamp") + if md.flag_clamp: + row = layout.row() + row.prop(md, "clamp_min_weight") + row.prop(md, "clamp_max_weight") + + row = layout.row() + row.prop(md, "flag_add2vg") + row.prop(md, "flag_remfvg") + row = layout.row() + if md.flag_add2vg: + row.prop(md, "add_threshold") + if md.flag_remfvg: + row.prop(md, "rem_threshold") + + # Common mask options… + layout.separator() + self.weight_vg_mask(layout, ob, md) + + def WEIGHT_VGMIX(self, layout, ob, md): + if ob.type == 'MESH': + split = layout.split() + col = split.column() + col.label(text="Vertex Group 1:") + col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + col.label(text="Default Weight 1:") + col.prop(md, "default_weight", text="") + + col.label(text="Mix Mode:") + col.prop(md, "mix_mode", text="") + + col = split.column() + col.label(text="Vertex Group 2:") + col.prop_search(md, "vertex_group2", ob, "vertex_groups", text="") + col.label(text="Default Weight 2:") + col.prop(md, "default_weight2", text="") + + col.label(text="Mix Set:") + col.prop(md, "mix_set", text="") + + # Common mask options… + layout.separator() + self.weight_vg_mask(layout, ob, md) + + def WEIGHT_VGPROXIMITY(self, layout, ob, md): + if ob.type == 'MESH': + split = layout.split() + col = split.column() + col.label(text="Vertex Group:") + col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + + col = split.column() + col.label(text="Target Object:") + col.prop(md, "ob_target", text="") + + row = layout.row() + row.prop(md, "proximity_mode", expand=True) + if md.proximity_mode == 'OBJ2VERTDIST': + row = layout.row() + row.prop(md, "obj2vert_verts") + row.prop(md, "obj2vert_edges") + row.prop(md, "obj2vert_faces") + + # Common mask options… + layout.separator() + self.weight_vg_mask(layout, ob, md) + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) -- cgit v1.2.3