[Bf-blender-cvs] [7c9bb24] temp-sybren-poselib: Explicitly switch to camera from either pose or scene marker.

Sybren A. Stüvel noreply at git.blender.org
Tue Nov 1 14:54:41 CET 2016


Commit: 7c9bb240f9752abcaab7aa3fe26cb808b844b085
Author: Sybren A. Stüvel
Date:   Fri Oct 14 11:13:35 2016 +0200
Branches: temp-sybren-poselib
https://developer.blender.org/rB7c9bb240f9752abcaab7aa3fe26cb808b844b085

Explicitly switch to camera from either pose or scene marker.

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

M	release/scripts/startup/bl_operators/poselib.py

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

diff --git a/release/scripts/startup/bl_operators/poselib.py b/release/scripts/startup/bl_operators/poselib.py
index 44c77ed..4a75f5f 100644
--- a/release/scripts/startup/bl_operators/poselib.py
+++ b/release/scripts/startup/bl_operators/poselib.py
@@ -93,6 +93,18 @@ class POSELIB_OT_render_previews(Operator):
         self.log.info('Rendering pose %s at frame %i', marker.name, marker.frame)
 
         context.scene.frame_set(marker.frame)
+        switch_to = None
+        if marker.camera:
+            switch_to = marker.camera
+        else:
+            cams = [m.camera for m in context.scene.timeline_markers
+                    if m.frame == marker.frame and m.camera]
+            if cams:
+                switch_to = cams[0]
+        if switch_to is not None:
+            self.log.info('Switching camera to %s', switch_to)
+            context.scene.camera = switch_to
+
         bpy.ops.poselib.apply_pose(pose_index=plib_index)
 
         fname = '%s.png' % marker.name




More information about the Bf-blender-cvs mailing list