transform_snap_object: return type of element snapped.
authormano-wii <germano.costa@ig.com.br>
Fri, 5 Jul 2019 21:23:06 +0000 (18:23 -0300)
committermano-wii <germano.costa@ig.com.br>
Fri, 5 Jul 2019 21:23:06 +0000 (18:23 -0300)
This can be useful for filtering some of the returns.

source/blender/editors/include/ED_transform_snap_object_context.h
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform_snap_object.c

index 75564ddd9471b4529611749f83a9ebf9405c7d1d..dab3bfe4b6dc96d97fbeb2ce6315e69584065c42 100644 (file)
@@ -121,7 +121,7 @@ bool ED_transform_snap_object_project_ray_all(SnapObjectContext *sctx,
                                               bool sort,
                                               struct ListBase *r_hit_list);
 
-bool ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *sctx,
+short ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *sctx,
                                                 const unsigned short snap_to,
                                                 const struct SnapObjectParams *params,
                                                 const float mval[2],
index b6eb57a3c81f2a1ed04a66de775c252b9cf5f089..38cec8add6bcc7111169601b893245411ae560c6 100644 (file)
@@ -4944,7 +4944,7 @@ void ED_view3d_cursor3d_position_rotation(bContext *C,
                                                    ray_no,
                                                    NULL,
                                                    &ob_dummy,
-                                                   obmat)) {
+                                                   obmat) != 0) {
       if (use_depth) {
         copy_v3_v3(cursor_co, ray_co);
       }
index 03c43c8d16d5e5b607063b9849353c5e37f7b232..aa31d1fc9879142f8ca3ce89f94e8881dfdbe93c 100644 (file)
@@ -2820,7 +2820,7 @@ static short transform_snap_context_project_view3d_mixed_impl(
   return 0;
 }
 
-bool ED_transform_snap_object_project_view3d_ex(SnapObjectContext *sctx,
+short ED_transform_snap_object_project_view3d_ex(SnapObjectContext *sctx,
                                                 const unsigned short snap_to,
                                                 const struct SnapObjectParams *params,
                                                 const float mval[2],
@@ -2856,7 +2856,7 @@ bool ED_transform_snap_object_project_view3d(SnapObjectContext *sctx,
                                              float r_no[3])
 {
   return ED_transform_snap_object_project_view3d_ex(
-      sctx, snap_to, params, mval, dist_px, r_loc, r_no, NULL, NULL, NULL);
+      sctx, snap_to, params, mval, dist_px, r_loc, r_no, NULL, NULL, NULL) != 0;
 }
 
 /**