[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43116] trunk/blender/source/blender: replace wave spesific enum with generic onces

Campbell Barton ideasman42 at gmail.com
Wed Jan 4 06:24:09 CET 2012


Revision: 43116
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43116
Author:   campbellbarton
Date:     2012-01-04 05:24:01 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
replace wave spesific enum with generic onces

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_modifier_types.h
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c
    trunk/blender/source/blender/modifiers/intern/MOD_wave.c

Modified: trunk/blender/source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_modifier_types.h	2012-01-04 05:13:29 UTC (rev 43115)
+++ trunk/blender/source/blender/makesdna/DNA_modifier_types.h	2012-01-04 05:24:01 UTC (rev 43116)
@@ -336,7 +336,7 @@
 	MOD_DISP_MAP_LOCAL,
 	MOD_DISP_MAP_GLOBAL,
 	MOD_DISP_MAP_OBJECT,
-	MOD_DISP_MAP_UV,
+	MOD_DISP_MAP_UV
 };
 
 typedef struct UVProjectModifierData {
@@ -401,13 +401,6 @@
 	short flag, type;
 } CastModifierData;
 
-enum {
-	MOD_WAV_MAP_LOCAL,
-	MOD_WAV_MAP_GLOBAL,
-	MOD_WAV_MAP_OBJECT,
-	MOD_WAV_MAP_UV,
-};
-
 /* WaveModifierData.flag */
 #define MOD_WAVE_X      (1<<1)
 #define MOD_WAVE_Y      (1<<2)

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2012-01-04 05:13:29 UTC (rev 43115)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2012-01-04 05:24:01 UTC (rev 43116)
@@ -1126,10 +1126,10 @@
 	PropertyRNA *prop;
 
 	static EnumPropertyItem prop_texture_coordinates_items[] = {
-		{MOD_WAV_MAP_LOCAL, "LOCAL", 0, "Local", ""},
-		{MOD_WAV_MAP_GLOBAL, "GLOBAL", 0, "Global", ""},
-		{MOD_WAV_MAP_OBJECT, "OBJECT", 0, "Object", ""},
-		{MOD_WAV_MAP_UV, "MAP_UV", 0, "UV", ""},
+		{MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", ""},
+		{MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""},
+		{MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""},
+		{MOD_DISP_MAP_UV, "MAP_UV", 0, "UV", ""},
 		{0, NULL, 0, NULL, NULL}};
 
 	srna= RNA_def_struct(brna, "WaveModifier", "Modifier");

Modified: trunk/blender/source/blender/modifiers/intern/MOD_wave.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_wave.c	2012-01-04 05:13:29 UTC (rev 43115)
+++ trunk/blender/source/blender/modifiers/intern/MOD_wave.c	2012-01-04 05:24:01 UTC (rev 43116)
@@ -73,7 +73,7 @@
 	wmd->lifetime= 0.0f;
 	wmd->damp= 10.0f;
 	wmd->falloff= 0.0f;
-	wmd->texmapping = MOD_WAV_MAP_LOCAL;
+	wmd->texmapping = MOD_DISP_MAP_LOCAL;
 	wmd->defgrp_name[0] = 0;
 }
 
@@ -160,7 +160,7 @@
 
 
 	/* ask for UV coordinates if we need them */
-	if(wmd->texture && wmd->texmapping == MOD_WAV_MAP_UV)
+	if(wmd->texture && wmd->texmapping == MOD_DISP_MAP_UV)
 		dataMask |= CD_MASK_MTFACE;
 
 	/* ask for vertexgroups if we need them */
@@ -178,15 +178,15 @@
 	int i;
 	int texmapping = wmd->texmapping;
 
-	if(texmapping == MOD_WAV_MAP_OBJECT) {
+	if(texmapping == MOD_DISP_MAP_OBJECT) {
 		if(wmd->map_object)
 			invert_m4_m4(wmd->map_object->imat, wmd->map_object->obmat);
 		else /* if there is no map object, default to local */
-			texmapping = MOD_WAV_MAP_LOCAL;
+			texmapping = MOD_DISP_MAP_LOCAL;
 	}
 
 	/* UVs need special handling, since they come from faces */
-	if(texmapping == MOD_WAV_MAP_UV) {
+	if(texmapping == MOD_DISP_MAP_UV) {
 		if(CustomData_has_layer(&dm->faceData, CD_MTFACE)) {
 			MFace *mface = dm->getFaceArray(dm);
 			MFace *mf;
@@ -236,18 +236,18 @@
 			MEM_freeN(done);
 			return;
 		} else /* if there are no UVs, default to local */
-			texmapping = MOD_WAV_MAP_LOCAL;
+			texmapping = MOD_DISP_MAP_LOCAL;
 	}
 
 	for(i = 0; i < numVerts; ++i, ++co, ++texco) {
 		switch(texmapping) {
-			case MOD_WAV_MAP_LOCAL:
+			case MOD_DISP_MAP_LOCAL:
 				copy_v3_v3(*texco, *co);
 				break;
-			case MOD_WAV_MAP_GLOBAL:
+			case MOD_DISP_MAP_GLOBAL:
 				mul_v3_m4v3(*texco, ob->obmat, *co);
 				break;
-			case MOD_WAV_MAP_OBJECT:
+			case MOD_DISP_MAP_OBJECT:
 				mul_v3_m4v3(*texco, ob->obmat, *co);
 				mul_m4_v3(wmd->map_object->imat, *texco);
 				break;



More information about the Bf-blender-cvs mailing list