[Bf-blender-cvs] [3cd98d9ef7e] blender2.8: Fix T56981: python .scene_raycast returned object is not selectable.
Bastien Montagne
noreply at git.blender.org
Sun Sep 30 23:55:19 CEST 2018
Commit: 3cd98d9ef7e6b85ec3c186f27879612265e3d85d
Author: Bastien Montagne
Date: Sun Sep 30 23:54:11 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB3cd98d9ef7e6b85ec3c186f27879612265e3d85d
Fix T56981: python .scene_raycast returned object is not selectable.
Was returning COW evaluated object, not actual data-block...
===================================================================
M source/blender/makesrna/intern/rna_scene_api.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 5a8c9646b0b..f25e093c8a9 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -66,6 +66,8 @@ const EnumPropertyItem rna_enum_abc_compression_items[] = {
#include "BKE_scene.h"
#include "BKE_writeavi.h"
+#include "DEG_depsgraph_query.h"
+
#include "ED_transform.h"
#include "ED_transform_snap_object_context.h"
#include "ED_uvedit.h"
@@ -185,6 +187,10 @@ static void rna_Scene_ray_cast(
ED_transform_snap_object_context_destroy(sctx);
+ if (r_ob != NULL && *r_ob != NULL) {
+ *r_ob = DEG_get_original_object(*r_ob);
+ }
+
if (ret) {
*r_success = true;
}
More information about the Bf-blender-cvs
mailing list