diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-05 16:49:44 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-05 16:59:52 +0300 |
commit | f6e798946092c5d30ad0c011bd8c2920971471b2 (patch) | |
tree | fec4dc809a96a4c531256140804a8fa7ad2af9b8 /release/scripts | |
parent | 2c3e4fbd7e91e7faeaaed3946874beb4be4e7817 (diff) |
Custom Loop Normals: Add NormalEdit modifier
Nothing much to say here, basic tool to make normals point toward a target,
or to make them point 'outward' as if object was a spheroid (useful for game bushes etc.).
Also, forgot a big thank you to Campbell for the extensive review work he has done on this project!
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 92e9e02ffca..283340bd9e1 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -1350,6 +1350,38 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): sub.active = bool(md.vertex_group) sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') + def NORMAL_EDIT(self, layout, ob, md): + has_vgroup = bool(md.vertex_group) + needs_object_offset = (((md.mode == 'RADIAL') and not md.target) or + ((md.mode == 'DIRECTIONAL') and md.use_direction_parallel)) + + row = layout.row() + row.prop(md, "mode", expand=True) + + split = layout.split() + + col = split.column() + col.prop(md, "target", text="") + sub = col.column(align=True) + sub.active = needs_object_offset + sub.prop(md, "offset") + row = col.row(align=True) + + col = split.column() + row = col.row() + row.active = (md.mode == 'DIRECTIONAL') + row.prop(md, "use_direction_parallel") + + subcol = col.column(align=True) + subcol.label("Mix Mode:") + subcol.prop(md, "mix_mode", text="") + subcol.prop(md, "mix_factor") + row = subcol.row(align=True) + row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + sub = row.row(align=True) + sub.active = has_vgroup + sub.prop(md, "use_invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) |