我想在Motionbuilder 2017中使用python来设置Vicon流媒体设备。
Vicon Stream Device | Download Page
from pyfbsdk import*
app = FBApplication()
scene = FBSystem().Scene
# Find the device
viconStreamingDevice = FBCreateObject( 'Browsing/Templates/Devices','Vicon Stream Device', "Vicon Stream Device")
# Import the device to the current file
scene.Devices.append(viconStreamingDevice)
# Execute the Device?
# ...
当我从资源浏览器中单击\拖动设备到我的场景中时,它可以正常工作。如果我使用上面的python脚本,设备会出现在场景中,但不能正常工作。下图显示了我选择该设备时导航器的外观。
Vicon Stream Device | Click\Drag Into Scene
Vicon Stream Device | Python Script
设备信息丢失,"model binding:“显示为灰色。此外,场景变得非常脆弱,并且在运行脚本后不久就会崩溃。
单击\拖动和使用上面的python脚本有什么不同?有没有办法使用python将Vicon流媒体设备导入Motionbuilder?
下面的答案信息(基于Paul Boots建议)
我最终手动初始化了设备,并将其连接到我打开的Vicon Shogun会话。我将设备设置为离线并保存了文件。下面是我在脚本中使用的代码,将设备合并到所需的场景中。
viconStreamDevice = r"D:\ViconStreamDevice.fbx"
MOptions = FBFbxOptions( True, viconStreamDevice )
app.FileMerge( viconStreamDevice, False, MOptions )
发布于 2018-05-30 17:18:23
在c++工具中添加设备时,我也遇到过类似的问题。我的工作是创建一个包含我的设备的模板文件,并从c++代码中打开它。您可以使用python尝试相同的技巧。
https://stackoverflow.com/questions/50497136
复制相似问题