[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39913] branches/vgroup_modifiers/source/ blender: minor edits.

Campbell Barton ideasman42 at gmail.com
Mon Sep 5 05:09:53 CEST 2011


Revision: 39913
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39913
Author:   campbellbarton
Date:     2011-09-05 03:09:49 +0000 (Mon, 05 Sep 2011)
Log Message:
-----------
minor edits.
- init proximity to 1.0f
- min/max proximity dist were not being copied.
- minor edits to comments - use ascii chars in a few places.

Modified Paths:
--------------
    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_weightvg_util.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvg_util.h
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgmix.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgproximity.c

Modified: branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h	2011-09-04 22:14:28 UTC (rev 39912)
+++ branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h	2011-09-05 03:09:49 UTC (rev 39913)
@@ -790,16 +790,13 @@
 typedef struct WeightVGEditModifierData {
 	ModifierData modifier;
 
-	/* XXX Note: I tried to keep everything logically ordered – provided the
-	 *           alignment constraints…
-	 */
+	/* Note: I tried to keep everything logically ordered - provided the
+	 * alignment constraints... */
 
 	char	defgrp_name[32];      /* Name of vertex group to edit. */
 
-	/* Flags (MOD_WVG_EDIT_MAP, MOD_WVG_EDIT_CMAP, MOD_WVG_EDIT_REVERSE_WEIGHTS,
-	 * MOD_WVG_EDIT_ADD2VG, MOD_WVG_EDIT_REMFVG, MOD_WVG_EDIT_CLAMP).
-	 */
-	int		edit_flags;
+	short	edit_flags;     /* using MOD_WVG_EDIT_* flags */
+	short	pad1;
 	float	default_weight; /* Weight for vertices not in vgroup. */
 
 	/* Mapping stuff. */
@@ -809,7 +806,7 @@
 	float	add_threshold, rem_threshold;
 
 	/* Masking options. */
-	float	mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
+	float	mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */
 	/* Name of mask vertex group from which to get weight factors. */
 	char	mask_defgrp_name[32];
 
@@ -817,10 +814,9 @@
 	int		mask_tex_use_channel;      /* Which channel to use as weightf. */
 	struct Tex *mask_texture;          /* The texture. */
 	struct Object *mask_tex_map_obj;   /* Name of the map object. */
-	/* How to map the texture (using MOD_DISP_MAP_xxx constants). */
+	/* How to map the texture (using MOD_DISP_MAP_* constants). */
 	int		mask_tex_mapping;
 	char	mask_tex_uvlayer_name[32]; /* Name of the UV layer. */
-
 	/* Padding… */
 	int pad_i1;
 } WeightVGEditModifierData;
@@ -843,21 +839,19 @@
 	ModifierData modifier;
 
 	/* XXX Note: I tried to keep everything logically ordered – provided the
-	 *           alignment constraints…
-	 */
+	 *           alignment constraints... */
 
 	char	defgrp_name[32];      /* Name of vertex group to modify/weight. */
 	char	defgrp_name2[32];     /* Name of other vertex group to mix in. */
 	float	default_weight;       /* Default weight value for first vgroup. */
 	float	default_weight2;      /* Default weight value to mix in. */
-	char	mix_mode;             /* How second vgroup’s weights affect first ones */
+	char	mix_mode;             /* How second vgroups weights affect first ones */
 	char	mix_set;              /* What vertices to affect. */
 
-	char	pad_c1, pad_c2;
-	int		pad_i1;
+	char	pad[6];
 
 	/* Masking options. */
-	float	mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
+	float	mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */
 	/* Name of mask vertex group from which to get weight factors. */
 	char	mask_defgrp_name[32];
 
@@ -867,12 +861,11 @@
 	struct Object *mask_tex_map_obj;   /* Name of the map object. */
 	int		mask_tex_mapping;          /* How to map the texture! */
 	char	mask_tex_uvlayer_name[32]; /* Name of the UV layer. */
-
 	/* Padding… */
-	int pad_i2;
+	int pad2;
 } WeightVGMixModifierData;
 
-/* How second vgroup’s weights affect first ones. */
+/* How second vgroup's weights affect first ones. */
 #define MOD_WVG_MIX_SET			1 /* Second weights replace weights. */
 #define MOD_WVG_MIX_ADD			2 /* Second weights are added to weights. */
 #define MOD_WVG_MIX_SUB			3 /* Second weights are subtracted from weights. */
@@ -891,9 +884,8 @@
 typedef struct WeightVGProximityModifierData {
 	ModifierData modifier;
 
-	/* XXX Note: I tried to keep everything logically ordered – provided the
-	 *           alignment constraints…
-	 */
+	/* Note: I tried to keep everything logically ordered - provided the
+	 * alignment constraints... */
 
 	char	defgrp_name[32];      /* Name of vertex group to modify/weight. */
 
@@ -901,11 +893,11 @@
 	int		proximity_mode;
 	int		proximity_flags;
 
-	/* Target object from which to calculate vertices’ distances. */
+	/* Target object from which to calculate vertices distances. */
 	struct Object *proximity_ob_target;
 
 	/* Masking options. */
-	float	mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
+	float	mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */
 	/* Name of mask vertex group from which to get weight factors. */
 	char	mask_defgrp_name[32];
 
@@ -918,8 +910,8 @@
 
 	float	min_dist, max_dist;        /* Distances mapping to 0.0/1.0 weights. */
 
-	/* Padding… */
-	int pad_i2;
+	/* Padding... */
+	int pad;
 } WeightVGProximityModifierData;
 
 /* Modes of proximity weighting. */

Modified: branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c	2011-09-04 22:14:28 UTC (rev 39912)
+++ branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c	2011-09-05 03:09:49 UTC (rev 39913)
@@ -2642,7 +2642,7 @@
 	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 "
+	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");
 
@@ -2650,7 +2650,7 @@
 	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 "
+	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");
 
@@ -2746,7 +2746,7 @@
 		{MOD_WVG_PROXIMITY_OBJECT, "OBJECT", 0, "Object Distance",
 		 "Use distance between affected and target objects."},
 		{MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance",
-		 "Use distance between affected object’s vertices and target object, or target object’s geometry."},
+		 "Use distance between affected object's vertices and target object, or target object's geometry."},
 		{0, NULL, 0, NULL, NULL}};
 
 	static EnumPropertyItem proximity_geometry_items[] = {
@@ -2760,7 +2760,7 @@
 
 	srna= RNA_def_struct(brna, "WeightVGProximityModifier", "Modifier");
 	RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier",
-	                       "Set the weights of vertices in a group from a target object’s "
+	                       "Set the weights of vertices in a group from a target object's "
 	                       "distance.");
 	RNA_def_struct_sdna(srna, "WeightVGProximityModifierData");
 	RNA_def_struct_ui_icon(srna, ICON_MOD_WEIGHTVG);
@@ -2780,12 +2780,12 @@
 	RNA_def_property_enum_sdna(prop, NULL, "proximity_flags");
 	RNA_def_property_enum_items(prop, proximity_geometry_items);
 	RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
-	RNA_def_property_ui_text(prop, "Proximity Geometry", "Use shortest distance to target object’s geometry as weight");
+	RNA_def_property_ui_text(prop, "Proximity Geometry", "Use shortest distance to target object's geometry as weight");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target");
-	RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices’ distances from.");
+	RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from.");
 	RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
 	RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
 

Modified: branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvg_util.c
===================================================================
--- branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvg_util.c	2011-09-04 22:14:28 UTC (rev 39912)
+++ branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvg_util.c	2011-09-05 03:09:49 UTC (rev 39913)
@@ -27,8 +27,8 @@
 */
 
 /*
- * XXX I’d like to make modified weights visible in WeightPaint mode,
- *     but couldn’t figure a way to do this…
+ * XXX I'd like to make modified weights visible in WeightPaint mode,
+ *     but couldn't figure a way to do this…
  *     Maybe this will need changes in mesh_calc_modifiers (DerivedMesh.c)?
  *     Or the WeightPaint mode code itself?
  */
@@ -61,9 +61,10 @@
  * XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear.
  */
 void weightvg_do_mask(int num, int *indices, float *org_w, float *new_w, Object *ob,
-                      DerivedMesh *dm, float fact, const char *defgrp_name, Tex *texture,
+                      DerivedMesh *dm, float fact, const char defgrp_name[32], Tex *texture,
                       int tex_use_channel, int tex_mapping, Object *tex_map_object,
-                      const char *tex_uvlayer_name) {
+                      const char *tex_uvlayer_name)
+{
 	int ref_didx;
 	MDeformVert *dvert = NULL;
 	int i;
@@ -80,9 +81,9 @@
 		float (*v_co)[3];
 
 		/* Use new generic get_texture_coords, but do not modify our DNA struct for it…
-		 * XXX Why use a ModifierData stuff here ? Why not a simple, generic struct for parameters ?
-		 *     What e.g. if a modifier wants to use several textures ?
-		 *     Why use only v_co, and not MVert (or both) ?
+		 * XXX Why use a ModifierData stuff here ? Why not a simple, generic struct for parameters ?
+		 *     What e.g. if a modifier wants to use several textures ?
+		 *     Why use only v_co, and not MVert (or both) ?
 		 */
 		t_map.texture = texture;
 		t_map.map_object = tex_map_object;
@@ -180,9 +181,10 @@
  * If indices is not NULL, it must be a table of same length as weights, mapping to the real

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list