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® FBX® / FBX SDK / FBX Extension Plugin's don't (try to) load in version 20113 ?
  RSS 2.0 ATOM  

FBX Extension Plugin's don't (try to) load in version 20113 ?
Rate this thread
 
49337
 
Permlink of this thread  
avatar
  • Total Posts: 8
  • Joined: 07 April 2010 10:36 AM

Hi,

I wish to export a custom node type from maya 2011 and 3dsmax 2009/2011 directly when exporting to FBX. To do this, an FBX Extension Plugin using the FBX Extension SDK v20113 is required.

As a first test, I compiled the MayaExtensionPlugin_Example on linux (xubuntu 9.1x64, gcc4.1.2, release build), and added some traces to stderr to be informed when the plugin is loaded. Unfortunately, this wasn’t the case. I assumed it may only load the plugin when performing the export, but exporting a mesh and checking the ascii fbx didn’t reveal any custom attributes that the extension plugin should have created ( nor did I see any of my traces ).
As I deemed a total failure of the tracing possible, I checked the open files of maya before and after the export, but there was no sign of the extension plugin which should have been loaded.

As its all about location, I thought maybe, it is just not finding my shared object, so I copied it from $MAYA_LOCATION/bin/plug-ins/fbx to the following additional directories:

$MAYA_LOCATION/bin/plug-ins/FBX
$MAYA_APP_DIR
/plug-ins/fbx 
$MAYA_APP_DIR
/plug-ins/FBX
$MAYA_APP_DIR
/2011-x64/plug-ins/fbx

All without success: the extension plugin would show now evidence of being loaded.

I tried the same on OSX (Leopard, Maya 2011x64, gcc4.2, release build), but it wouldn’t try to load the extension plugin.

As the extension SDK manual for version 2011 keeps talking about version 2010, I though maybe it is only tested and verified to work with maya 2010 too. This time, I tried on windows (WinXP x64, Maya 2010, VS2005, release configuration), for this to work, I converted the provided VS2008 project for Maya2010 to VS2005 respectively. My attempt was a failure once again, but maybe it couldn’t work as the FBX Extension SDK v20113 was used with Maya2010. But why would there be a configuration for Maya 2010 in the example’s folder then ?

In all my tests, the sample plugin didn’t show any sign of being loaded, or a load-failure of some sort, which makes me wonder where the problem could possibly be. To me it looks the Fbx Maya Plugin doesn’t even try to load my dll. Maybe the compiler created an incompatible dll/so file, but the exact same compiler versions generate valid plugins for maya, and I would assume the fbx maya plugin is compatible to that too as it is being loaded by maya just fine.

Today a colleague of mine tried the same procedure with 3dsMax2009x64 and the Fbx 3DsMaxPlugin v20113 which was available from the Autodesk website, on Windows 7 x64 using VS2005, but even here the sample 3dsmax plugin showed no trace of being loaded. This was verified using a debugger.

A commonality between all the tests is that a 64 bit Maya/Max was used - could that be the source of the problem?
Apparently there have been people who got a working ExtensionPlugin, and I would be absolutely glad if they could share their insights with me, as having such a plugin will greatly simplify our current development project.

Kind Regards,
Sebastian Thiel



Replies: 0
avatar

I just tried with the new FBX Extension SDK 2011.3.1, compiled the 3dsMax2011Extension_Example in Debug 32-bit configuration, copied the resulting DLL into the 3dsMax2011\stdplugs\fbx folder, created a random mesh (a sphere in this case) and exported it to FBX 2011 format ASCII.

The FBX file contained the CustomData as expected. Can you confirm this test works on your side?



Robert Goulet, FBX Dev Lead

Replies: 1
/userdata/avatar/n63vdc577_byron_sublit_small.jpg

Hi Robert,

Unfortunately, I don’t have access to 3dsmax myself, my colleague can only use the 64 bit version. Using the 32 bit version is not an option for us either, and so far the only reports of working fbx extension plug-ins originated on 32 bit versions of max and maya.
Considering that I didn’t do anything else than you when compiling the maya plugin, except that I tried it with the 64 bit version, maybe it really only works on 32 bit architectures.

I would be absolutely glad if there was anyone who could confirm that fbx extension plugins worked for him on a 64 bit version of max or maya.

Regards,
Sebastian

Author: Sebastian Thiel

Replied: 06 December 2010 12:29 AM  
avatar

It works in Maya 2011 64 bit with Visual Studio 2010.

You can debug it directly by changing the Maya 2011 Extension Plugin example:

Change the build target location to:
c:\Program Files\Autodesk\Maya2011\bin\plug-ins\FBX\Maya2011ExtensionPlugin_Example.dll

Change the executable to:
C:\Program Files\Autodesk\Maya2011\bin\maya.exe
so Maya is run.

Put break points the plugin code. Initially, they will be disabled.

F5 to run. You will get warning about no debug symbols. Ignore this.

Export FBX file format causes the MayaExt_Export* functions to be called.



Replies: 0
avatar

Resolution

Yes, it works now, but I will document my findings here, as they might be interesting to others.

Once I forced myself into thinking that the bug is on my side, somewhere, I spent some additional time to hunt down the cause(s) of my troubles, first, on linux.
I use Xubuntu 10.04 LTS as operating system, and started by compiling g++ in version 4.1.2 just to be sure there is no binary compilation hickup somewhere down the road. Previously I just use the g++ 4.1 interpreter installed on my system.
Still, my fbx extension plugin (->FEP) would not load.

Next I examined the files and folders the maya process tries to deal with when loading the fbx maya plugin (->FMP), using strace

strace --e trace=file -o maya.trace.log path/to/maya2011

This showed that my maya version was actually trying to find the fbx plugin in maya2011-x64/bin/fbx instead of in
maya2011-x64/bin/plug-ins/fbx. Well, that shouldn’t be a problem, and I put my FEP into the folder it actually tried to open.

Another strace showed that it was actually trying to do something with the plugin file, but still there was no sign of it working in the exported fbx file. If there was an error, it apparently doesn’t tell anything about it, no log, no trace, nothing that could help me to figure out what the problem was.

To see the error, I wrote a little program that would load my FEP. I configured the LD_LIBRARY_PATH so that the additional maya libraries could be found. The program is as simple as it gets:

#include <dlfcn.h>
#include <iostream>

int main(int argc, const charargv[])
{
 
if (argc 2){
     std
::cerr << "Require first arg to be file to test as extension plugin" << std::endl;
     return 
1;
 
}
 
 void
handle dlopen(argv[1]RTLD_NOW);
 if (!
handle){
     std
::cerr << dlerror() << std::endl;
     return 
2;
 
}
 
 
return 0;
}

Now I could toss in any shared object, and it would try to load it. Errors on its way it will spit out to stderr. What happened when I tried to load the FEP was interesting: The FEP was linked against fbxmaya.so, which was loaded and pulled in part of maya, and while loading, it tried to load the FEP from the location in bin/fbx. This triggered an error which it would just ignore without querying it, leaving it accessible in my code. This revealed that it couldn’t find an FBX SDK symbol which should in fact be defined in the FMP.

A quick

nm -<FEP>.so

and

nm -<FMP>.so

showed the cause of the issue: The namespace was wrong !. The FMP’s namespace ended with 2011_1 whereas my FEP’s namespace ended with 2011_3_1, which is because I compiled it against the latest downloadable fbx extension sdk. This is something that really should have been more explicitly stated in the extension programmers PDF file - I only took it as a rough guide as the file named <...>2011_2.pdf was constantly referring to maya 2010.

Great, so I download the FBX Extension SDK 2011.1, right ? Well, after I have, for the third time probably, entered my details to actually get to the fbx download page, I had to see that the required fbx extension sdk version is not in the download archive. I smiled ... and went on to see whether there were any updates, at least I could remember to have downloaded, but not installed, my subscription update, but in addition to this I have seen the SP1 for Maya 2011, which caused me to download about 2.5 GB to get the linux and windows version. I remember times when the download was only 300 MB, but these are over, I see that now !

Once I had the latest version of Maya installed on linux, I used my AP edition after all, I could check the fbx sdk version it used using nm, and it would show something available this time, 2011_3. Once again to the download page for fbx (no, I left it open this time so I wouldn’t have to enter my details again), to download another 500 MB for the linux and windows version respectively, blindly assuming that the windows build of the FMP would actually use the same version as windows ;).

Finally, once I had recompiled my FEP, I was very keen to finally see it being loaded, but ... not this time ! Another strace session revealed that the FMP would now look in the somewhat right place, being bin/plug-ins/FBX. The capitalized FBX is something which is not reflected in the extension sdk documentation (PDF) by the way. This flaw won’t be an issue on windows though, which is probably why no one noticed it so far.

Alright, I sensed I must be close now, so I put my FEP into the right folder, and tried again ... a tear rolled down my cheek when I first saw the CustomData entries in the Filmbox file !

My quest is not yet over though, installing Maya 2011 AP on windows took forever, and once again I am questioning the sanity of Autodesk’s distribution package for maya. Fortunately, the FEP I compiled with version 2011_3 of the FBX extension SDK worked right away the way it should.

Admittedly, finally succeeding over the FEP-issues is quite a rewarding feeling, but something tells me it shouldn’t have been that hard in the first place. I hope the next iteration of FBX will improve in that respect.

Thanks to everyone who replied - you definitely helped to keep me going,
Sebastian



Replies: 2
/userdata/avatar/3yvwf23us_doug100x100.png

In the readme.txt file for the FBX extensions:

For Maya:
{Maya Installed folder}\bin\plug-ins\fbx\

Note: If the folder named “fbx” does not exists yet, you will need to create it.
IMPORTANT: on MacOS and Linux, this folder needs to be named “FBX”
(the capital letters are mandatory).

but it would be nice to include that in the official docs.

Author: Doug Rogers

Replied: 07 December 2010 10:32 AM  
/userdata/avatar/vx3501hqr_small.jpg

Hi, Sebastian, thanks for sharing your findings here.
It seems the main problem is the Maya plug-in and the extension SDK you used did not match.
If you are compiling your own plugin against the latest downloadable fbx extension sdk, then you need to use the latest Maya/Max plugin too. But yes, we should document this more clearly.

BTW, to get the latest Maya plugins, you do not need to download the whole Maya, only download the newest FBX plug-in for Maya should be enough, from http://www.autodesk.com\fbx, Download Free* FBX Plug-ins, FBX Converter, and FBX QuickTime Viewer.

Hi Doug, we will refine the documents for extension sdk to include these info in readme.txt, thanks.

Author: Jiayang Xu

Replied: 07 December 2010 07:07 PM