[Bf-blender-cvs] [27d31c15e88] blender-v3.3-release: UI: Pass modifier & constraint icon to the corresponding RNA base type

Julian Eisel noreply at git.blender.org
Thu Aug 4 16:14:58 CEST 2022


Commit: 27d31c15e88914e87a0a881072a5a9ee0c99eb48
Author: Julian Eisel
Date:   Thu Aug 4 15:39:36 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB27d31c15e88914e87a0a881072a5a9ee0c99eb48

UI: Pass modifier & constraint icon to the corresponding RNA base type

NOTE: This is committed to the 3.3 branch as part of D15606, which we
decided should go to this release still (by Bastien, Dalai and me). That
is because these are important usability fixes/improvements to have for
the LTS release.

This basically lets the UI use the constraint or modifier icon, whenever
refering to constraints/modifiers via RNA pointers. Used by D15606, so
that the "Modifiers" tree element to group the individual modifiers
together gets the right icon without hardcoded handling.

===================================================================

M	source/blender/makesrna/intern/rna_constraint.c
M	source/blender/makesrna/intern/rna_modifier.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 986de0930ed..719c7441174 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -3450,6 +3450,7 @@ void RNA_def_constraint(BlenderRNA *brna)
   RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
   RNA_def_struct_path_func(srna, "rna_Constraint_path");
   RNA_def_struct_sdna(srna, "bConstraint");
+  RNA_def_struct_ui_icon(srna, ICON_CONSTRAINT);
 
   /* strings */
   prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 4810784b3f7..0e420f7556f 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -7243,6 +7243,7 @@ void RNA_def_modifier(BlenderRNA *brna)
   RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
   RNA_def_struct_path_func(srna, "rna_Modifier_path");
   RNA_def_struct_sdna(srna, "ModifierData");
+  RNA_def_struct_ui_icon(srna, ICON_MODIFIER);
 
   /* strings */
   prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);



More information about the Bf-blender-cvs mailing list