|
Hey all,
I have a question regarding Device addition to a scene via Python. I can’t seem to find anything anywhere. I would like to add a device and then be able to toggle it online or offline if needed.
I saw a post on here from 2008 that stated it was NOT possible without using the FileMerge() command and loading in a saved scene with the device. This will not work for my case. Just wondering if there is such a command in MoBu 2012.
Thanks!
-Brian
|
|
|
|
Still the same I’m afraid. You are not able to create devices from Python, only modify them once they are there. As you mentioned, the only way is to merge in a file that has a device in it.
As it is not always guaranteed that bringing in a device will connect to the desired hardware, especially if you have more than one piece of hardware plugged in. The best work around I had was to have the user create the device, ensure that it is working with the desired piece of hardware, then run the script, using whatever handle you want to get the device (selection, naming etc). That way it guarantees that the device is there and working and ready for scripted manipulation.
|
|
|
|
We’ve been getting around this using the FBCreateObject Command and it seems to work without a problem. (In 2010+)
Something like:
lTC = FBCreateObject("Browsing/Templates/Devices","LTC", "TestLTC")
FBSystem().Scene.Devices.append(lTC)
lTC.RecordMode = True
This still has the limitation that all of the properties on standard MB devices that are contained in the UI Layout of the device are not available unless they are in the property list. However you can at least get to online/live/record + information area and anything in the property list.
Cheers,
Kevin
Kevin O’Neal
Ubisoft
Montreal, Quebec
|
|
|