|
I am relatively new to python in mobu and am trying to change attributes of a certain camera via python. Specifically the Focal Length and toggling items such as Title Safe and the grid.
What i can’t figure out is how to select a camera based on its name and then proceed to change its attributes.
Any suggestions?
Thanks!
|
|
|
|
Hi,
here is a quick example how to get access to the cameras in your mobu-scene:
from pyfbsdk import *
# we are getting an object instance of the whole scene myScene = FBSystem().Scene
# we know that myScene.Cameras is a list of objects, the cameras
# Therefore we iterate through this list by every object and print out the name for obj in myScene.Cameras:
print obj.Name
This is a very simple way to get any information about your scene. Look up “FBScene” in the Mobu SDK Help(Mobu-Menu->Help->Motionbuilder SDK Help). There you can find any other attributes or functions this class holds or can execute if it is instanced as an object we have access to via python.
If you look for FBCamera(the camera object class) you will find a huge amount of camera attributes you can reach, e.g. FocalLength. :)
If we add this knowledge to our little script:
from pyfbsdk import *
myScene = FBSystem().Scene
for obj in myScene.Cameras:
#prints out the name
print obj.Name
#prints out the FocalLength
print obj.FocalLength
That’s it for the start. :)
Cheers,
Chris
|
|
|