Optical Device setup with Python

Optical Device setup with Python

Anonymous
Not applicable
797 Views
1 Reply
Message 1 of 2

Optical Device setup with Python

Anonymous
Not applicable

Hello,

 

I am writing a Python script to move an Optical Device into my scene and properly set it up. Here is what I have so far:

 

from pyfbsdk import *

from pyfbsdk_additions import *

 

def FindDevice( pName 😞

    lResult = None

    for lDevice in FBSystem().Scene.Devices:

        if lDevice.Name == pName:

            lResult = lDevice

            break

    return lResult

 

op = FBModelOptical("OP")

lTC = FBCreateObject("Browsing/Templates/Devices","Device Name", "Device Name")

FBSystem().Scene.Devices.append(lTC)

 

d = FindDevice("Device Name")

 

So far this script creates an optical model and puts my optical device in the scene. I can use commands like "d.Online = True" and it will work, however I cannot seem to be able to set the optical model for this device. 

 

I have tried:

 

d.OpticalModel = op

d.SetOpticalModel = op

 

I'm sure that I am just not using the proper assignment for this object. If anyone has any information on this it would be greatly appreciated.

 

Thanks

-Chris

 

 

0 Likes
798 Views
1 Reply
Reply (1)
Message 2 of 2

brissef2
Autodesk
Autodesk

Hi MoCapocalypse,

 

I guess your Optical Device is a custom device that derives from an FBDevice.

There is any methods/properties which contains the name "Optical" on the FBDevice class. So I guess this is a method/property on your custom Optical Device.

At this point, I am unsure it is possible to help you without further information.

 

Please let us know of any additional information you may have.

 

Best regards,

Francis

0 Likes