Modifiers: Add Bone option for Texture Mask Object

This patch adds the option to use an armature bone in place of an object for texture mask coordinates.

This affects the 3 vertex weight modifiers, the displace modifier, the warp modifier, and the wave modifier.

With minor changes from Bastien Montagne (@mont29).

Differential Revision: https://developer.blender.org/D7348
This commit is contained in:
Cody Winchester
2020-04-10 14:03:36 +02:00
committed by Bastien Montagne
parent d6cefef98f
commit 4f9a56cbc4
12 changed files with 99 additions and 14 deletions

View File

@@ -396,6 +396,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
if md.texture_coords == 'OBJECT':
col.label(text="Object:")
col.prop(md, "texture_coords_object", text="")
obj = md.texture_coords_object
if obj and obj.type == 'ARMATURE':
col.label(text="Bone:")
col.prop_search(md, "texture_coords_bone", obj.data, "bones", text="")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
col.label(text="UV Map:")
col.prop_search(md, "uv_layer", ob.data, "uv_layers", text="")
@@ -1244,6 +1248,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
if md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coords_object", text="Object")
obj = md.texture_coords_object
if obj and obj.type == 'ARMATURE':
layout.prop_search(md, "texture_coords_bone", obj.data, "bones", text="Bone")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_layers")
@@ -1296,6 +1303,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.prop_search(md, "uv_layer", ob.data, "uv_layers")
elif md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coords_object")
obj = md.texture_coords_object
if obj and obj.type == 'ARMATURE':
layout.prop_search(md, "texture_coords_bone", obj.data, "bones")
layout.separator()
@@ -1366,6 +1376,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
if md.mask_tex_mapping == 'OBJECT':
layout.prop(md, "mask_tex_map_object", text="Object")
obj = md.mask_text_map_object
if obj and obj.type == 'ARMATURE':
layout.prop_search(md, "mask_tex_map_bone", obj.data, "bones", text="Bone")
elif md.mask_tex_mapping == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "mask_tex_uv_layer", ob.data, "uv_layers")