From ba1f7acc3f5091398c0c1f2eaabfd7546dde39f8 Mon Sep 17 00:00:00 2001 From: Cody Winchester Date: Fri, 27 Mar 2020 10:27:00 +0100 Subject: Warp modifier: add bone from and bone to options when using armature objects This commit adds the option to use armature bones for the From and To targets when using armature objects. The changes are based on the UV Warp modifier. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D6820 --- source/blender/makesrna/intern/rna_modifier.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index e0c9be7ddae..51b50647e1d 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1795,17 +1795,29 @@ static void rna_def_modifier_warp(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_MOD_WARP); prop = RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE); - RNA_def_property_ui_text(prop, "From", "Object to transform from"); + RNA_def_property_pointer_sdna(prop, NULL, "object_from"); + RNA_def_property_ui_text(prop, "Object From", "Object to transform from"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + prop = RNA_def_property(srna, "bone_from", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "bone_from"); + RNA_def_property_ui_text(prop, "Bone From", "Bone to transform from"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + prop = RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE); - RNA_def_property_ui_text(prop, "To", "Object to transform to"); + RNA_def_property_pointer_sdna(prop, NULL, "object_to"); + RNA_def_property_ui_text(prop, "Object To", "Object to transform to"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + prop = RNA_def_property(srna, "bone_to", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "bone_to"); + RNA_def_property_ui_text(prop, "Bone To", "Bone defining offset"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 10, 2); -- cgit v1.2.3