Camera navigation plugin with 2012 API and COM API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm building a camera control plugin for a 3D mouse to do navigation in Navisworks 2012 with the plugin API and COM API (since 2012 doesn't support robust camera manipulation in the standard .NET API as far as I know). It looks like I may be able to do this in a more robust manner in the 2013 API (I haven't upgraded yet and am unsure when that would happen) with new .NET API support for camera manipulation, but for the sake of getting it up and running in 2012:
I set up a thread that polls data from my device and uses it to update the translation and rotation of the camera using the COM API. When I do this directly in a C# plugin, the performance is terrible. However, I found a sample camera manipulation plugin from 2010 that utilizes a Windows Form to do one-off camera moves and rotations. When I ran my code through the Windows Form (that opens as a modal dialog in the main thread, suspending the Navisworks window), the performance is MUCH closer to normal/acceptable range. So this is usable but not ideal since I have to close the Windows Form to resume normal Navisworks operation and open the plugin again everytime I want to navigate with my 3D mouse.
Is there anyway to circumvent this and get decent performance/framerate when manipulating the camera in real time directly in a C# plugin with the COM API? Maybe the COM functionality wasn't built for this sort of application, but I was wondering if there was something I was missing that could alleviate whatever calculations Navisworks is doing every time the camera transformation gets reset. I also think it could be related to Naviswork's logging of Undo actions since the Undo button flickers every time the camera is moving. Is there a way to disable logging of Undo actions for camera moves or Undo actions in general? I can set the Undo buffer size to 0 in Options but that doesn't seem to make a difference.
Thanks