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.
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).
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.