[Bf-blender-cvs] [8e73b77] master: Remove slurph shape-key feature

Campbell Barton noreply at git.blender.org
Tue Jan 6 16:06:56 CET 2015


Commit: 8e73b770d4e9da71fb727444611657732cc52047
Author: Campbell Barton
Date:   Wed Jan 7 02:02:55 2015 +1100
Branches: master
https://developer.blender.org/rB8e73b770d4e9da71fb727444611657732cc52047

Remove slurph shape-key feature

This is an old option which wasn't working in over a year without complaint.

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

M	release/scripts/modules/bl_i18n_utils/utils_spell_check.py
M	release/scripts/startup/bl_ui/properties_data_mesh.py
M	source/blender/blenkernel/BKE_key.h
M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/intern/displist.c
M	source/blender/blenkernel/intern/key.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/editors/object/object_shapekey.c
M	source/blender/makesdna/DNA_key_types.h
M	source/blender/makesrna/intern/rna_key.c
M	source/blender/makesrna/intern/rna_object_api.c
M	source/blender/modifiers/intern/MOD_shapekey.c
M	source/blender/render/intern/source/convertblender.c

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

diff --git a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
index 7ded3d6..587aaed 100644
--- a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
+++ b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
@@ -220,7 +220,6 @@ class SpellChecker():
         "polycount",
         "polygonization", "polygonalization",  # yuck!
         "selectability",
-        "slurph",
         "stitchable",
         "symmetrize",
         "trackability",
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 7178e17..670ecf4 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -317,7 +317,6 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
                 row = layout.column()
                 row.active = enable_edit_value
                 row.prop(key, "eval_time")
-                row.prop(key, "slurph")
 
 
 class DATA_PT_uv_texture(MeshButtonsPanel, Panel):
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index 31b2c7d..9535b92 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -60,9 +60,11 @@ void key_curve_position_weights(float t, float data[4], int type);
 void key_curve_tangent_weights(float t, float data[4], int type);
 void key_curve_normal_weights(float t, float data[4], int type);
 
-float *BKE_key_evaluate_object_ex(struct Scene *scene, struct Object *ob, int *r_totelem,
-                                  float *arr, size_t arr_size);
-float *BKE_key_evaluate_object(struct Scene *scene, struct Object *ob, int *r_totelem);
+float *BKE_key_evaluate_object_ex(
+        struct Object *ob, int *r_totelem,
+        float *arr, size_t arr_size);
+float *BKE_key_evaluate_object(
+        struct Object *ob, int *r_totelem);
 
 struct Key      *BKE_key_from_object(struct Object *ob);
 struct KeyBlock *BKE_keyblock_from_object(struct Object *ob);
@@ -111,9 +113,6 @@ bool    BKE_keyblock_move(struct Object *ob, int org_index, int new_index);
 
 bool    BKE_keyblock_is_basis(struct Key *key, const int index);
 
-/* key.c */
-extern int slurph_opt;
-
 #ifdef __cplusplus
 };
 #endif
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 1bfd26d..1bdbc33 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -181,7 +181,7 @@ int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float *
 
 int BKE_object_insert_ptcache(struct Object *ob);
 void BKE_object_delete_ptcache(struct Object *ob, int index);
-struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, const bool from_mix);
+struct KeyBlock *BKE_object_insert_shape_key(struct Object *ob, const char *name, const bool from_mix);
 
 bool BKE_object_is_child_recursive(struct Object *ob_parent, struct Object *ob_child);
 bool BKE_object_is_animated(struct Scene *scene, struct Object *ob);
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 80a8d37..9ea5a56 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -813,7 +813,7 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, ListBase *nurb,
 		required_mode |= eModifierMode_Editmode;
 
 	if (cu->editnurb == NULL) {
-		keyVerts = BKE_key_evaluate_object(scene, ob, &numVerts);
+		keyVerts = BKE_key_evaluate_object(ob, &numVerts);
 
 		if (keyVerts) {
 			/* split coords from key data, the latter also includes
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 3ba0c6e..32e95e7 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -73,10 +73,6 @@
 #define IPO_BEZTRIPLE   100
 #define IPO_BPOINT      101
 
-/* extern, not threadsafe */
-int slurph_opt = 1;
-
-
 void BKE_key_free(Key *key)
 {
 	KeyBlock *kb;
@@ -607,7 +603,7 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
 	k1 = key_block_get_data(key, actkb, kb, &freek1);
 	kref = key_block_get_data(key, actkb, key->refkey, &freekref);
 
-	/* this exception is needed for slurphing */
+	/* this exception is needed curves with multiple splines */
 	if (start != 0) {
 		
 		poin += poinsize * start;
@@ -891,7 +887,7 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
 		}
 	}
 
-	/* this exception needed for slurphing */
+	/* this exception is needed for curves with multiple splines */
 	if (start != 0) {
 
 		poin += poinsize * start;
@@ -1168,53 +1164,29 @@ void BKE_keyblock_free_per_block_weights(Key *key, float **per_keyblock_weights,
 	MEM_freeN(per_keyblock_weights);
 }
 
-static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int tot)
+static void do_mesh_key(Object *ob, Key *key, char *out, const int tot)
 {
 	KeyBlock *k[4], *actkb = BKE_keyblock_from_object(ob);
 	float t[4];
 	int flag = 0;
 
-	if (key->slurph && key->type != KEY_RELATIVE) {
+	if (key->type == KEY_RELATIVE) {
+		WeightsArrayCache cache = {0, NULL};
+		float **per_keyblock_weights;
+		per_keyblock_weights = BKE_keyblock_get_per_block_weights(ob, key, &cache);
+		BKE_key_evaluate_relative(0, tot, tot, (char *)out, key, actkb, per_keyblock_weights, KEY_MODE_DUMMY);
+		BKE_keyblock_free_per_block_weights(key, per_keyblock_weights, &cache);
+	}
+	else {
 		const float ctime_scaled = key->ctime / 100.0f;
-		float delta = (float)key->slurph / tot;
-		float cfra = BKE_scene_frame_get(scene);
-		int step, a;
-
-		if (tot > 100 && slurph_opt) {
-			step = tot / 50;
-			delta *= step;
-			/* in do_key and cp_key the case a>tot is handled */
-		}
-		else {
-			step = 1;
-		}
 
-		for (a = 0; a < tot; a += step, cfra += delta) {
-			flag = setkeys(ctime_scaled, &key->block, k, t, 0);
+		flag = setkeys(ctime_scaled, &key->block, k, t, 0);
 
-			if (flag == 0)
-				do_key(a, a + step, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
-			else
-				cp_key(a, a + step, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
-		}
-	}
-	else {
-		if (key->type == KEY_RELATIVE) {
-			WeightsArrayCache cache = {0, NULL};
-			float **per_keyblock_weights;
-			per_keyblock_weights = BKE_keyblock_get_per_block_weights(ob, key, &cache);
-			BKE_key_evaluate_relative(0, tot, tot, (char *)out, key, actkb, per_keyblock_weights, KEY_MODE_DUMMY);
-			BKE_keyblock_free_per_block_weights(key, per_keyblock_weights, &cache);
+		if (flag == 0) {
+			do_key(0, tot, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
 		}
 		else {
-			const float ctime_scaled = key->ctime / 100.0f;
-
-			flag = setkeys(ctime_scaled, &key->block, k, t, 0);
-
-			if (flag == 0)
-				do_key(0, tot, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
-			else
-				cp_key(0, tot, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
+			cp_key(0, tot, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
 		}
 	}
 }
@@ -1259,135 +1231,63 @@ static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, char *out, const
 	}
 }
 
-static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const int tot)
+static void do_curve_key(Object *ob, Key *key, char *out, const int tot)
 {
 	Curve *cu = ob->data;
 	KeyBlock *k[4], *actkb = BKE_keyblock_from_object(ob);
 	float t[4];
 	int flag = 0;
 
-	if (key->slurph && key->type != KEY_RELATIVE) {
+	if (key->type == KEY_RELATIVE) {
+		do_rel_cu_key(cu, cu->key, actkb, out, tot);
+	}
+	else {
 		const float ctime_scaled = key->ctime / 100.0f;
-		float delta = (float)key->slurph / tot;
-		float cfra = BKE_scene_frame_get(scene);
-		Nurb *nu;
-		int i = 0, remain = 0;
-		int step, a;
 
-		if (tot > 100 && slurph_opt) {
-			step = tot / 50;
-			delta *= step;
-			/* in do_key and cp_key the case a>tot has been handled */
-		}
-		else {
-			step = 1;
-		}
+		flag = setkeys(ctime_scaled, &key->block, k, t, 0);
 
-		for (nu = cu->nurb.first; nu; nu = nu->next) {
-			int estep, mode;
-
-			if (nu->bp) {
-				mode = KEY_MODE_BPOINT;
-				estep = nu->pntsu * nu->pntsv;
-			}
-			else if (nu->bezt) {
-				mode = KEY_MODE_BEZTRIPLE;
-				estep = 3 * nu->pntsu;
-			}
-			else {
-				mode = 0;
-				estep = 0;
-			}
-
-			a = 0;
-			while (a < estep) {
-				int count;
-
-				if (remain <= 0) {
-					cfra += delta;
-					flag = setkeys(ctime_scaled, &key->block, k, t, 0);
-
-					remain = step;
-				}
-
-				count = min_ii(remain, estep);
-				if (mode == KEY_MODE_BEZTRIPLE) {
-					count += 3 - count % 3;
-				}
-
-				if (flag == 0)
-					do_key(i, i + count, tot, (char *)out, key, actkb, k, t, mode);
-				else
-					cp_key(i, i + count, tot, (char *)out, key, actkb, k[2], NULL, mode);
-
-				a += count;
-				i += count;
-				remain -= count;
-			}
-		}
-	}
-	else {
-		if (key->type == KEY_RELATIVE) {
-			do_rel_cu_key(cu, cu->key, actkb, out, tot);
+		if (flag == 0) {
+			do_cu_key(cu, key, actkb, k, t, out, tot);
 		}
 		else {
-			const float ctime_scaled = key->ctime / 100.0f;
-
-			flag = setkeys(ctime_scaled, &key->block, k, t, 0);
-
-			if (flag == 0) do_cu_key(cu, key, actkb, k, t, out, tot);
-			else cp_cu_key(cu, key, actkb, k[2], 0, tot, out, tot);
+			cp_cu_key(cu, key, actkb, k[2], 0, tot, out, tot);
 		}
 	}
 }
 
-static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int tot)
+static void do_latt_key(Object *ob, Key *key, char *out, const int tot)
 {
 	Lattice *lt = ob->data;
 	KeyBlock *k[4], *actkb = BKE_keyblock_from_object(ob);
 	float t[4];
 	int flag;
 	
-	if (key->slurph && key->type != KEY_RELATIVE) {
-		const float ctime_scaled = key->ctime / 100.0f;
-		float delta = (float)key->slurph / tot;
-		float cfra = BKE_scene_frame_get(scene);
-		int a;
-
-		for (a = 0; a < tot; a++, cfra += delta) {
-			flag = setkeys(ctime_scaled, &key->block, k, t, 0);
-
-			if (flag == 0)
-				do_key(a, a + 1, tot, out, key, actkb, k, t, KEY_MODE_DUMMY);
-			else
-				cp_key(a, a + 1, tot, out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
-		}
+	if (

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list