I’ve been trying to create my own non-linear Lens. As a starting point, I copied fisheyeLens.{cxx,h,I} to a directory outside the project source directory.
I renamed “[Ff]isheye” to “[Pp]hisheye” and shouted:
Panda3D version: 1.8.1, from the latest tarball on the website. Uninstalled Ubuntu package, built from source.
gcc: 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
Python: 2.7.3
I’m not sure what Dtool_Gay8JGY6 is, but I’m guessing it’s the name of a function that was automatically generated by interrogate. Is it defined in the _igate.cxx file? If so, could you paste its definition?
One problem that immediately jumps out is that you correctly specified -python-native to the interrogate command, but failed to specify it to the interrogate_module command, so the two programs are generating incompatible code. Make sure that you specify the correct command-line parameters to both tools–they are confusingly powerful and many of their features are abandoned or no longer used.
Thanks, that did it (almost): I removed the -python' switch from theinterrogate’ command and added -python-native' to theinterrogate_module’ command.
I also had to change the library name from libPhisheyeLens to phisheyeLens so it matched the name of the output file from the compilation command (before that, I got an error saying “dynamic module does not define init function (initphisheyeLens)”).
Now I can compile and import PhisheyeLens', and even use it instead ofFisheyeLens’ in the example code found in this thread. I’m getting a warning, though, wenn `PhisheyeLens’ is imported: “Class PhisheyeLens has a zero TypeHandle value; check that init_type() is called.” Is that something I should worry about?
For reference: this is how I generate the code and compile the module.
This means that you did not call init_type() of the class at static init time. See config_distort.cxx. The ConfigureFn macro is used to create a static initialiser that calls init_libdistort when the library is loaded, which calls init_type() on all the typed classes.