Fix T66694: depthdropper (camera focus distance) not working from View3D context...
authorPhilipp Oeser <info@graphics-engineer.com>
Thu, 11 Jul 2019 15:53:13 +0000 (17:53 +0200)
committerPhilipp Oeser <info@graphics-engineer.com>
Fri, 12 Jul 2019 12:03:58 +0000 (14:03 +0200)
Reviewers: campbellbarton, brecht

Maniphest Tasks: T66694

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

source/blender/editors/interface/interface_eyedropper_depth.c

index adb317f488cf50472dfe7da7813eb0beece6431b..fc60fc06ac0e5441b5dc4bd1efe829c86e1dfb9f 100644 (file)
@@ -31,6 +31,7 @@
 #include "DNA_space_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_object_types.h"
+#include "DNA_camera_types.h"
 #include "DNA_view3d_types.h"
 
 #include "BLI_string.h"
@@ -102,8 +103,9 @@ static int depthdropper_init(bContext *C, wmOperator *op)
     if (rv3d && rv3d->persp == RV3D_CAMOB) {
       View3D *v3d = CTX_wm_view3d(C);
       if (v3d->camera && v3d->camera->data && !ID_IS_LINKED(v3d->camera->data)) {
-        RNA_id_pointer_create(v3d->camera->data, &ddr->ptr);
-        ddr->prop = RNA_struct_find_property(&ddr->ptr, "dof_distance");
+        Camera *camera = (Camera *)v3d->camera->data;
+        RNA_pointer_create(&camera->id, &RNA_CameraDOFSettings, &camera->dof, &ddr->ptr);
+        ddr->prop = RNA_struct_find_property(&ddr->ptr, "focus_distance");
         ddr->is_undo = true;
       }
     }