[Bf-blender-cvs] [161e90f7ac5] blender-v2.83-release: Fix T90651: camera reconstruction crash without scene camera

Philipp Oeser noreply at git.blender.org
Mon Aug 30 11:35:43 CEST 2021


Commit: 161e90f7ac51a3f3e1b4a9685caf9cd5d559bbf8
Author: Philipp Oeser
Date:   Mon Aug 16 08:38:15 2021 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB161e90f7ac51a3f3e1b4a9685caf9cd5d559bbf8

Fix T90651: camera reconstruction crash without scene camera

This was working differently in 2.79, tried tracking this down and it
seems this was wrong since the 2.8 beginning in {rB7907dfc40018}.

This would not only crash without an active scene camera, but would also
result in different tracks from different camera's constraints could not
be selected.

So select id depends on corresponding camera, remove the dependency on
scene camera completely.

Maniphest Tasks: T90651

Differential Revision: https://developer.blender.org/D12230

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

M	source/blender/draw/engines/overlay/overlay_extra.c

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

diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index 653fd22769e..3cef3af6668 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -862,13 +862,11 @@ typedef union OVERLAY_CameraInstanceData {
 static void camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb,
                                          Scene *scene,
                                          View3D *v3d,
-                                         Object *camera_object,
                                          Object *ob,
                                          const float color[4])
 {
   const DRWContextState *draw_ctx = DRW_context_state_get();
   const bool is_select = DRW_state_is_select();
-  const Object *orig_camera_object = DEG_get_original_object(camera_object);
 
   MovieClip *clip = BKE_object_movieclip_get(scene, ob, false);
   if (clip == NULL) {
@@ -942,7 +940,7 @@ static void camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb,
       }
 
       if (is_select) {
-        DRW_select_load_id(orig_camera_object->runtime.select_id | (track_index << 16));
+        DRW_select_load_id(ob->runtime.select_id | (track_index << 16));
         track_index++;
       }
 
@@ -1251,7 +1249,7 @@ void OVERLAY_camera_cache_populate(OVERLAY_Data *vedata, Object *ob)
 
   /* Motion Tracking. */
   if ((v3d->flag2 & V3D_SHOW_RECONSTRUCTION) != 0) {
-    camera_view3d_reconstruction(cb, scene, v3d, camera_object, ob, color_p);
+    camera_view3d_reconstruction(cb, scene, v3d, ob, color_p);
   }
 
   /* Background images. */



More information about the Bf-blender-cvs mailing list