|
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 -f -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 char* argv[]) {
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 -C <FEP>.so
and
nm -C <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
|