Page 1 of 1

OptiTrack Model binding question

Posted: Mon Feb 20, 2012 8:05 pm
by phanig
Hi there,

I trying to programtically gather camera information to which the OptiTrack plugin is model binded to.

Goal is to trigger certain scripts on to a camera, to which OptiTrack plugin is binded to. I'm using Motionbuilder 2012 and programming in python.

Can any one please throw some light on this. Thank you very much.

---Phaneendra

Re: OptiTrack Model binding question

Posted: Tue Feb 21, 2012 12:42 pm
by morgan
Hey Phaneendra -

I just sent AJ an email with a script on this - but here it is for anyone else looking:

# show current camera
lSystem = FBSystem()
lCurrentCamera = lSystem.Renderer.CurrentCamera
print "Current Camera: " + lCurrentCamera.LongName


# get camera from current VCS model binding
strCurrentVCSCamera = ""
for lDevice in FBSystem().Scene.Devices:
print "device: " + lDevice.LongName
for lTemplate in lDevice.ModelTemplate.Children:
print " current template model: " + lTemplate.Model.LongName
for lTemplate2 in lTemplate.Model.Children:
strCurrentVCSCamera = lTemplate2.LongName
print " current template model children: " + strCurrentVCSCamera

for lCamera in FBSystem().Scene.Cameras:
if lCamera.LongName == strCurrentVCSCamera:
lCurrentVCSCamera = lCamera

print "Current VCS camera: " + lCurrentVCSCamera.LongName


output:

Current Camera: Producer Perspective
device: OptiTrack Insight VCS
current template model: VCS 5:Root
current template model children: VCS 5:Camera
Current VCS camera: VCS 5:Camera



Hope this helps,

Morgan

Re: OptiTrack Model binding question

Posted: Sun Mar 04, 2012 12:50 pm
by phanig
Thank you Morgan.