Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Open Reality / FBCustomManager, Deleted Objects, and FBPropertyEvent
  RSS 2.0 ATOM  

FBCustomManager, Deleted Objects, and FBPropertyEvent
Rate this thread
 
54992
 
Permlink of this thread  
avatar
  • ZachHall
  • Posted: 26 April 2011 03:43 AM
  • Total Posts: 5
  • Joined: 07 June 2010 01:58 PM

Hello!

I’m having some trouble in regards to using FBApplication callbacks in my CustomManager class. When I try to create a member object of class FBApplication, I get a disassembly error. If I try to create a local copy of FBApplication, any callbacks I register to that instance are never called.

In an attempt to work around this restriction, I’ve encountered another problem. There does not appear to be any way to detect if an object has been deleted, either by the user, or by the system during Clear, Open, or New file operations. This means that references to those objects are dangerous, because attempting to call a function on an object that has been deleted will cause a crash. Pointers to FBComponent objects are not set to NULL when the object is deleted but it looks like the mLocalPtr attribute is, unfortunately those member attributes are private, and can’t be tested directly.

In a third attempt to work around this limitation I created a derived version of the FBNote class and overloaded the destructor. I was going to create an OnNoteDestroyed event callback to hook my CustomManager class too, but then I realized that I have no idea how to create a new event broadcaster.

There are no examples of how to do it, and the documentation is extremely sparse. I imagine it has something to do with the FBPropertyEvent class, but I have had no luck finding an example of usage anywhere.

Any help that anyone has on solving any of these problems would be much appreciated.



Replies: 0