【发布时间】:2018-11-02 23:03:21
【问题描述】:
我想使用 python 在 Motionbuilder 2017 中设置 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
设备信息丢失,“模型绑定:”显示为灰色。此外场景变得非常脆弱,运行脚本后很快就会崩溃。
点击\拖动和使用上面的python脚本有什么区别?有没有办法使用 python 将 Vicon 流媒体设备导入 Motionbuilder?
下面的答案信息(基于 Paul Boots 的建议)
我最终手动初始化设备并将其连接到我打开的 Vicon Shogun 会话。我将设备设置为离线并保存了文件。下面是我在脚本中用于将设备合并到所需场景的代码。
viconStreamDevice = r"D:\ViconStreamDevice.fbx"
MOptions = FBFbxOptions( True, viconStreamDevice )
app.FileMerge( viconStreamDevice, False, MOptions )
【问题讨论】:
标签: python autodesk motionbuilder