From e87ab444db76f41693d4eeaa5edc4ada7bb32d38 Mon Sep 17 00:00:00 2001
From: Damien Picard <dam.pic@free.fr>
Date: Sun, 18 Sep 2022 02:55:10 +0200
Subject: [PATCH] Create Camera Rigs: fix DoF bone for 2D rig

---
 add_camera_rigs/__init__.py  | 2 +-
 add_camera_rigs/operators.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/add_camera_rigs/__init__.py b/add_camera_rigs/__init__.py
index cbf83d95e..2f6735694 100644
--- a/add_camera_rigs/__init__.py
+++ b/add_camera_rigs/__init__.py
@@ -3,7 +3,7 @@
 bl_info = {
     "name": "Add Camera Rigs",
     "author": "Wayne Dixon, Brian Raschko, Kris Wittig, Damien Picard, Flavio Perez",
-    "version": (1, 5, 0),
+    "version": (1, 5, 1),
     "blender": (3, 3, 0),
     "location": "View3D > Add > Camera > Dolly or Crane Rig",
     "description": "Adds a Camera Rig with UI",
diff --git a/add_camera_rigs/operators.py b/add_camera_rigs/operators.py
index 29e77e3bc..ce3a8b008 100644
--- a/add_camera_rigs/operators.py
+++ b/add_camera_rigs/operators.py
@@ -82,7 +82,9 @@ class ADD_CAMERA_RIGS_OT_set_dof_bone(Operator, CameraRigMixin):
         rig, cam = get_rig_and_cam(context.active_object)
 
         cam.data.dof.focus_object = rig
-        cam.data.dof.focus_subtarget = 'Aim_shape_rotation-MCH'
+        cam.data.dof.focus_subtarget = (
+            'Center-MCH' if rig["rig_id"].lower() == '2d_rig'
+            else 'Aim_shape_rotation-MCH')
 
         return {'FINISHED'}
 
-- 
GitLab