[Bf-blender-cvs] [9619a90da13] blender2.8: Scene raycast: The return index should indicate the polygon instead of the looptri.

Germano noreply at git.blender.org
Tue May 15 20:38:29 CEST 2018


Commit: 9619a90da13ce615542907834c62aef6d63f3658
Author: Germano
Date:   Tue May 15 15:38:17 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB9619a90da13ce615542907834c62aef6d63f3658

Scene raycast: The return index should indicate the polygon instead of the looptri.

This was the default behavior and could break some addon since looptri is almost useless for the current python API.

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

M	source/blender/editors/transform/transform_snap_object.c

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

diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index b60fa96d197..9140e8a4ba0 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -514,7 +514,7 @@ static bool raycastMesh(
 				retval = true;
 
 				if (r_index) {
-					*r_index = hit.index;
+					*r_index = treedata->looptri[hit.index].poly;
 				}
 			}
 		}
@@ -663,7 +663,7 @@ static bool raycastEditMesh(
 				retval = true;
 
 				if (r_index) {
-					*r_index = hit.index;
+					*r_index = BM_elem_index_get(em->looptris[hit.index][0]->f);
 				}
 			}
 		}



More information about the Bf-blender-cvs mailing list