python - 通过 Python 设置 Vicon 流设备
问题描述
我想使用 python 在 Motionbuilder 2017 中设置 Vicon 流媒体设备。
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 脚本,设备会出现在场景中但不能正常工作。下图显示了当我选择设备时导航器的外观。
设备信息丢失,“模型绑定:”显示为灰色。此外,场景变得非常脆弱,运行脚本后很快就会崩溃。
点击\拖动和使用上面的python脚本有什么区别?有没有办法使用 python 将 Vicon 流媒体设备导入 Motionbuilder?
下面的答案信息(基于 Paul Boots 的建议)
我最终手动初始化设备并将其连接到我打开的 Vicon Shogun 会话。我将设备设置为离线并保存了文件。下面是我在脚本中用于将设备合并到所需场景的代码。
viconStreamDevice = r"D:\ViconStreamDevice.fbx"
MOptions = FBFbxOptions( True, viconStreamDevice )
app.FileMerge( viconStreamDevice, False, MOptions )
解决方案
在 c++ 工具中添加设备时,我遇到了类似的问题。我的工作是创建一个包含我的设备的模板文件并从 c++ 代码中打开它。您可以使用 python 尝试相同的技巧。
推荐阅读
- permissions - 如何允许网站在 Microsoft Edge 上请求地理定位权限
- matplotlib - 使用 pyplot 在 Julia 中进行 3d 绘图排序/分层
- qt - 在 debian 上工作的 qt / gstreamer 代码在 rasbian 上不起作用
- reactjs - undefined 不是一个函数(在'...React.createClass...'附近)
- javascript - 仅当表单数据有效时如何在同一页面上显示表单数据?
- excel - 使用 getopenfilename 和 vlookup 从关闭的工作簿中获取数据
- jquery - jQuery 函数相互覆盖
- android - Android Studio:引导类路径未与 -source 1.6 一起设置
- python - 何时在条带中的计费周期结束时按月收费
- go - 为golang prometheus收集器添加标签