OptiTrack Model binding question

Post Reply
phanig
Posts: 2
Joined: Mon Dec 19, 2011 4:37 pm

OptiTrack Model binding question

Post 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
morgan
NaturalPoint Employee
NaturalPoint Employee
Posts: 199
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA
Contact:

Re: OptiTrack Model binding question

Post 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
phanig
Posts: 2
Joined: Mon Dec 19, 2011 4:37 pm

Re: OptiTrack Model binding question

Post by phanig »

Thank you Morgan.
Post Reply