Last active
September 27, 2016 13:34
-
-
Save fusepilot/f18599d8c2489b8be1ac to your computer and use it in GitHub Desktop.
C4D Activate Camera on Frame Tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d | |
import re | |
""" | |
1. Create python tag on camera and add this code to it. | |
2. Duplicate tag to other cameras. | |
3. Rename your camera layers to match the frame you want it be be active on, e.g., cam-1, Camera01, 01. | |
""" | |
def main(): | |
cam = op.GetObject() | |
bd = doc.GetActiveBaseDraw() | |
frame = doc.GetTime().GetFrame(doc.GetFps()) | |
cam_name = cam.GetName() | |
cam_frame = int((re.findall('\d+', cam_name))[0]) | |
if frame == cam_frame: | |
bd.SetSceneCamera(cam) | |
c4d.EventAdd() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment