[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38772] branches/vgroup_modifiers: minor cleanup of rna
Campbell Barton
ideasman42 at gmail.com
Thu Jul 28 03:38:51 CEST 2011
Revision: 38772
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38772
Author: campbellbarton
Date: 2011-07-28 01:38:48 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
minor cleanup of rna
- use an rna enum-set for proximity vert/edge/face options.
- rename some flags.
- better conform to rna naming conventions.
Modified Paths:
--------------
branches/vgroup_modifiers/release/scripts/startup/bl_ui/properties_data_modifier.py
branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h
branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c
branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c
branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgproximity.c
Modified: branches/vgroup_modifiers/release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- branches/vgroup_modifiers/release/scripts/startup/bl_ui/properties_data_modifier.py 2011-07-28 00:29:06 UTC (rev 38771)
+++ branches/vgroup_modifiers/release/scripts/startup/bl_ui/properties_data_modifier.py 2011-07-28 01:38:48 UTC (rev 38772)
@@ -777,8 +777,8 @@
col.label(text="Default Weight:")
col.prop(md, "default_weight", text="")
- layout.prop(md, "flag_map")
- if md.flag_map:
+ layout.prop(md, "use_map")
+ if md.use_map:
split = layout.split()
col = split.column()
col.label("Input:")
@@ -790,27 +790,27 @@
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, "use_map_curve")
+ if md.use_map_curve:
+ col = layout.column()
+ col.template_curve_mapping(md, "map_curve")
- layout.prop(md, "flag_reverse")
+ layout.prop(md, "use_reverse")
- layout.prop(md, "flag_clamp")
- if md.flag_clamp:
+ layout.prop(md, "use_clamp")
+ if md.use_clamp:
row = layout.row()
- row.prop(md, "clamp_min_weight")
- row.prop(md, "clamp_max_weight")
+ row.prop(md, "clamp_weight_min")
+ row.prop(md, "clamp_weight_max")
row = layout.row()
- row.prop(md, "flag_add2vg")
- row.prop(md, "flag_remfvg")
+ row.prop(md, "use_add")
+ row.prop(md, "use_remove")
row = layout.row()
- if md.flag_add2vg:
+ if md.use_add:
row.prop(md, "add_threshold")
- if md.flag_remfvg:
- row.prop(md, "rem_threshold")
+ if md.use_remove:
+ row.prop(md, "remove_threshold")
# Common mask options…
layout.separator()
@@ -850,15 +850,13 @@
col = split.column()
col.label(text="Target Object:")
- col.prop(md, "ob_target", text="")
+ col.prop(md, "target", text="")
row = layout.row()
row.prop(md, "proximity_mode", expand=True)
- if md.proximity_mode == 'OBJ2VERTDIST':
+ if md.proximity_mode == 'GEOMETRY':
row = layout.row()
- row.prop(md, "obj2vert_verts")
- row.prop(md, "obj2vert_edges")
- row.prop(md, "obj2vert_faces")
+ row.prop(md, "proximity_geometry", expand=True)
# Common mask options…
layout.separator()
Modified: branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h 2011-07-28 00:29:06 UTC (rev 38771)
+++ branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h 2011-07-28 01:38:48 UTC (rev 38772)
@@ -810,7 +810,7 @@
float add_threshold, rem_threshold;
/* Clamping options. */
- float clamp_min_weight, clamp_max_weight;
+ float clamp_weight_min, clamp_weight_max;
/* Masking options. */
float mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
@@ -846,7 +846,7 @@
typedef struct WeightVGMixModifierData {
ModifierData modifier;
- /* XXX Note: I tried to keep everything logically ordered – provided the
+ /* XXX Note: I tried to keep everything logically ordered – provided the
* alignment constraints…
*/
@@ -926,17 +926,17 @@
/* Modes of proximity weighting. */
/* Dist from target object to affected object. */
-#define MOD_WVG_PROXIMITY_OBJ2OBJDIST 1
+#define MOD_WVG_PROXIMITY_OBJECT 1 /* source vertex to other location */
/* Dist from target object to vertex. */
-#define MOD_WVG_PROXIMITY_OBJ2VERTDIST 2
+#define MOD_WVG_PROXIMITY_GEOMETRY 2 /* source vertex to other geometry */
/* Flags options for proximity weighting. */
-/* Use nearest vertices of target obj, in OVJ2VERTDIST mode. */
-#define MOD_WVG_PROXIMITY_O2VD_VERTS (1 << 0)
-/* Use nearest edges of target obj, in OVJ2VERTDIST mode. */
-#define MOD_WVG_PROXIMITY_O2VD_EDGES (1 << 1)
-/* Use nearest faces of target obj, in OVJ2VERTDIST mode. */
-#define MOD_WVG_PROXIMITY_O2VD_FACES (1 << 2)
+/* Use nearest vertices of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
+#define MOD_WVG_PROXIMITY_GEOM_VERTS (1 << 0)
+/* Use nearest edges of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
+#define MOD_WVG_PROXIMITY_GEOM_EDGES (1 << 1)
+/* Use nearest faces of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
+#define MOD_WVG_PROXIMITY_GEOM_FACES (1 << 2)
/* Defines common to all WeightVG modifiers. */
/* Tex channel to be used as mask. */
Modified: branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c 2011-07-28 00:29:06 UTC (rev 38771)
+++ branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c 2011-07-28 01:38:48 UTC (rev 38772)
@@ -2553,34 +2553,34 @@
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "flag_map", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_MAP);
RNA_def_property_ui_text(prop, "Map", "Map vertex group weights.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "flag_curve_map", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_CMAP);
RNA_def_property_ui_text(prop, "Curve Map", "Map vertex group weights with a curve.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "flag_reverse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REVERSE_WEIGHTS);
RNA_def_property_ui_text(prop, "Reverse", "Reverse vertex group weights.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "flag_add2vg", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG);
RNA_def_property_ui_text(prop, "Add to VG", "Add vertices with weight over threshold "
"to vgroup.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "flag_remfvg", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG);
RNA_def_property_ui_text(prop, "Rem from VG", "Remove vertices with weight below threshold "
"from vgroup.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "flag_clamp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_clamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_CLAMP);
RNA_def_property_ui_text(prop, "Clamp", "Clamp vertex group weights.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2620,32 +2620,34 @@
RNA_def_property_ui_text(prop, "Output High Weight", "High output mapping value.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "cmap_curve", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve");
RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "add_threshold");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100000.0, 100000.0, 10, 0);
RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex’s weight "
"to be added to the vgroup.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "rem_threshold", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rem_threshold");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100000.0, 100000.0, 10, 0);
RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex’s weight "
"to be removed from the vgroup.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "clamp_min_weight", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clamp_weight_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100000.0, 100000.0, 10, 0);
RNA_def_property_ui_text(prop, "Min Weight", "Lowest weight a vertex can get.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "clamp_max_weight", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clamp_weight_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100000.0, 100000.0, 10, 0);
RNA_def_property_ui_text(prop, "Max Weight", "Highest weight a vertex can get.");
@@ -2728,12 +2730,18 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list