[Bf-blender-cvs] [ad8a35a] master: Dyntopo: Solve issue with test file by Jens.

Antony Riakiotakis noreply at git.blender.org
Thu Apr 17 23:11:15 CEST 2014


Commit: ad8a35a6593fc17f8b6bde3c813e7000bd2600b0
Author: Antony Riakiotakis
Date:   Fri Apr 18 00:11:05 2014 +0300
https://developer.blender.org/rBad8a35a6593fc17f8b6bde3c813e7000bd2600b0

Dyntopo: Solve issue with test file by Jens.

Seems like custom data indices can be mangled when many layers are
present in the mesh, so use more strict calculation of offset (copied
over from BM_CD_LAYER_ID).

I was under the impression that all custom data would be deleted on
entering dyntopo, it seems this is not the case though.

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

M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 16c0f9b..5f0ff4a 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4805,7 +4805,8 @@ void sculpt_dyntopo_node_layers_add(SculptSession *ss)
 		cd_node_layer_index = CustomData_get_named_layer_index(&ss->bm->vdata, CD_PROP_INT, layer_id);
 	}
 
-	ss->cd_vert_node_offset = CustomData_get_n_offset(&ss->bm->vdata, CD_PROP_INT, cd_node_layer_index);
+	ss->cd_vert_node_offset = CustomData_get_n_offset(&ss->bm->vdata, CD_PROP_INT,
+	                                                  cd_node_layer_index - CustomData_get_layer_index(&ss->bm->vdata, CD_PROP_INT));
 
 	ss->bm->vdata.layers[cd_node_layer_index].flag |= CD_FLAG_TEMPORARY;
 
@@ -4815,7 +4816,8 @@ void sculpt_dyntopo_node_layers_add(SculptSession *ss)
 		cd_node_layer_index = CustomData_get_named_layer_index(&ss->bm->pdata, CD_PROP_INT, layer_id);
 	}
 
-	ss->cd_face_node_offset = CustomData_get_n_offset(&ss->bm->pdata, CD_PROP_INT, cd_node_layer_index);
+	ss->cd_face_node_offset = CustomData_get_n_offset(&ss->bm->pdata, CD_PROP_INT,
+	                                                  cd_node_layer_index - CustomData_get_layer_index(&ss->bm->pdata, CD_PROP_INT));
 
 	ss->bm->pdata.layers[cd_node_layer_index].flag |= CD_FLAG_TEMPORARY;
 }




More information about the Bf-blender-cvs mailing list