[Bf-blender-cvs] [b01c944] soc-2014-shapekey: Small speedup - compute hash only if there are keyblocks

Grigory Revzin noreply at git.blender.org
Thu Jun 12 18:03:25 CEST 2014


Commit: b01c9445523891c0377a887805dcf1794154a110
Author: Grigory Revzin
Date:   Thu Jun 12 20:03:13 2014 +0400
https://developer.blender.org/rBb01c9445523891c0377a887805dcf1794154a110

Small speedup - compute hash only if there are keyblocks

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

M	source/blender/editors/mesh/editmesh_utils.c

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

diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index a234141..37002d1 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -383,8 +383,9 @@ void EDBM_mesh_make(ToolSettings *ts, Object *ob)
 
 	/* we need to flush selection because the mode may have changed from when last in editmode */
 	EDBM_selectmode_flush(me->edit_btmesh);
-
-	BKE_editmesh_topochange_calc(me->edit_btmesh);
+	
+	if (BKE_key_from_object(ob) && BKE_keyblock_from_object(ob))
+		BKE_editmesh_topochange_calc(me->edit_btmesh);
 }
 
 void EDBM_mesh_load(Object *ob)
@@ -674,7 +675,7 @@ bool EDBM_mesh_from_editmesh(Object *obedit, bool do_free)
 		return false;
 	}
 
-	if (me->key) {
+	if (BKE_key_from_object(obedit) && BKE_keyblock_from_object(obedit)) {
 		if (BKE_editmesh_topo_has_changed(em)) {
 			BKE_key_editdata_to_scratch(obedit, false);
 		}




More information about the Bf-blender-cvs mailing list