Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'add_camera_rigs')
-rw-r--r--add_camera_rigs/__init__.py4
-rw-r--r--add_camera_rigs/operators.py28
-rw-r--r--add_camera_rigs/ui_panels.py33
3 files changed, 30 insertions, 35 deletions
diff --git a/add_camera_rigs/__init__.py b/add_camera_rigs/__init__.py
index 878d4555..cbf83d95 100644
--- a/add_camera_rigs/__init__.py
+++ b/add_camera_rigs/__init__.py
@@ -3,8 +3,8 @@
bl_info = {
"name": "Add Camera Rigs",
"author": "Wayne Dixon, Brian Raschko, Kris Wittig, Damien Picard, Flavio Perez",
- "version": (1, 4, 4),
- "blender": (2, 80, 0),
+ "version": (1, 5, 0),
+ "blender": (3, 3, 0),
"location": "View3D > Add > Camera > Dolly or Crane Rig",
"description": "Adds a Camera Rig with UI",
"doc_url": "{BLENDER_MANUAL_URL}/addons/camera/camera_rigs.html",
diff --git a/add_camera_rigs/operators.py b/add_camera_rigs/operators.py
index 18300e08..29e77e3b 100644
--- a/add_camera_rigs/operators.py
+++ b/add_camera_rigs/operators.py
@@ -73,30 +73,16 @@ class ADD_CAMERA_RIGS_OT_add_marker_bind(Operator, CameraRigMixin):
return {'FINISHED'}
-class ADD_CAMERA_RIGS_OT_add_dof_object(Operator, CameraRigMixin):
- bl_idname = "add_camera_rigs.add_dof_object"
- bl_label = "Add DOF Object"
- bl_description = "Create Empty and add as DOF Object"
+class ADD_CAMERA_RIGS_OT_set_dof_bone(Operator, CameraRigMixin):
+ bl_idname = "add_camera_rigs.set_dof_bone"
+ bl_label = "Set DOF Bone"
+ bl_description = "Set the Aim bone as a DOF target"
def execute(self, context):
rig, cam = get_rig_and_cam(context.active_object)
- bone = rig.data.bones['Aim_shape_rotation-MCH']
- # Add Empty
- empty_obj = bpy.data.objects.new("EmptyDOF", None)
- context.scene.collection.objects.link(empty_obj)
-
- # Parent to Aim Child bone
- empty_obj.parent = rig
- empty_obj.parent_type = "BONE"
- empty_obj.parent_bone = "Aim_shape_rotation-MCH"
-
- # Move to bone head
- empty_obj.location = bone.head
-
- # Make this new empty the dof_object
- cam.data.dof.use_dof = True
- cam.data.dof.focus_object = empty_obj
+ cam.data.dof.focus_object = rig
+ cam.data.dof.focus_subtarget = 'Aim_shape_rotation-MCH'
return {'FINISHED'}
@@ -104,7 +90,7 @@ class ADD_CAMERA_RIGS_OT_add_dof_object(Operator, CameraRigMixin):
classes = (
ADD_CAMERA_RIGS_OT_set_scene_camera,
ADD_CAMERA_RIGS_OT_add_marker_bind,
- ADD_CAMERA_RIGS_OT_add_dof_object,
+ ADD_CAMERA_RIGS_OT_set_dof_bone,
)
diff --git a/add_camera_rigs/ui_panels.py b/add_camera_rigs/ui_panels.py
index c6066147..5d545d3a 100644
--- a/add_camera_rigs/ui_panels.py
+++ b/add_camera_rigs/ui_panels.py
@@ -32,20 +32,23 @@ class ADD_CAMERA_RIGS_PT_camera_rig_ui(Panel, CameraRigMixin):
layout.prop(cam_data, "type")
# DoF
- col = layout.column(align=True)
+ col = layout.column(align=False)
col.prop(cam_data.dof, "use_dof")
if cam_data.dof.use_dof:
- if rig["rig_id"].lower() in ("crane_rig", "dolly_rig"):
- if cam_data.dof.focus_object is None:
- col.operator("add_camera_rigs.add_dof_object",
- text="Add DOF Empty", icon="OUTLINER_OB_EMPTY")
- else:
- col.prop(cam_data.dof, "focus_object")
- row = col.row(align=True)
+ sub = col.column(align=True)
+ if cam_data.dof.focus_object is None:
+ sub.operator("add_camera_rigs.set_dof_bone")
+ sub.prop(cam_data.dof, "focus_object")
+ if (cam_data.dof.focus_object is not None
+ and cam_data.dof.focus_object.type == 'ARMATURE'):
+ sub.prop_search(cam_data.dof, "focus_subtarget",
+ cam_data.dof.focus_object.data, "bones")
+ sub = col.column(align=True)
+ row = sub.row(align=True)
row.active = cam_data.dof.focus_object is None
row.prop(pose_bones["Camera"],
'["focus_distance"]', text="Focus Distance")
- col.prop(pose_bones["Camera"],
+ sub.prop(pose_bones["Camera"],
'["aperture_fstop"]', text="F-Stop")
# Viewport display
@@ -74,9 +77,15 @@ class ADD_CAMERA_RIGS_PT_camera_rig_ui(Panel, CameraRigMixin):
if rig["rig_id"].lower() in ("dolly_rig", "crane_rig"):
# Track to Constraint
col = layout.column(align=True)
- col.label(text="Tracking:")
- col.prop(pose_bones["Camera"].constraints["Track To"],
- 'influence', text="Aim Lock", slider=True)
+ track_to_constraint = None
+ for con in pose_bones["Camera"].constraints:
+ if con.type == 'TRACK_TO':
+ track_to_constraint = con
+ break
+ if track_to_constraint is not None:
+ col.label(text="Tracking:")
+ col.prop(track_to_constraint, 'influence',
+ text="Aim Lock", slider=True)
# Crane arm stuff
if rig["rig_id"].lower() == "crane_rig":