Area :: Header
Sweat, Swearing & Tears
Cupcakes & Critters reflects on what it takes to bring an indie game to market. Watch now
Discussion Groups

Open Reality

15 Posts
0 Kudos
Registered: ‎11-24-2011

When does FbxRetrieved is called?

41 Views, 2 Replies
01-10-2012 07:40 AM

I've got a problem to read the additional data I write in the FBX with my plugin.
If I open MB, open my plugin tool, close it and open an FBX, the additional data are retrieved.
But if I open MB and open directly an FBX, the additional data aren't retrieved.

As if the tool should be instantiated at least once to be activated.
IMHO, it's a bug. Am I right? Is there a workaround to this problem?

I'm on MotionBuilder 2011 64bits, Windows 7.
190 Posts
3 Kudos
Registered: ‎08-23-2006

Re: When does FbxRetrieved is called?

01-10-2012 01:10 PM in reply to: HerrBean
Unfortunatly yes this is an issue, here are some potential workarounds:

One workaround would be to, of course, make the tool visible as specified in a custom layout. However, if the user starts up with a layout that does not include the tool, then FbxRetrieve will not be called unless the tool is made visible and the file is reopened.

Anothr one is to use a class derived from FBUserObject in conjuction with your tool. See the ortoolpersistent sample. By placing an FBUserObject, which has its own FbxStore and FbxRetrieve, in the scene, you can place the data you need in some intermediate place, i.e. the user object, such that when the tool is made visible, it can retrieve the data from the user object. Without the user object, there's no way to obtain the data from the FBX file until you make your tool visible and you reopen the file (which forces FbxRetreive of your tool to be called).

15 Posts
0 Kudos
Registered: ‎11-24-2011

Re: When does FbxRetrieved is called?

01-11-2012 06:30 AM in reply to: HerrBean
Thanks for these explanations, I'll try that!
I also found another workaround, but user-side so it's not the best. Ask the users to save their layout after having opened the tool. Next time MB is opened, it instantiates the tool in the background.