Here's a working template of a GeoReader plugin:

#include <DDImage/GeoReader.h>

using namespace DD::Image;


class templateReader: public GeoReader {
protected:
   void geometry_engine(Scene& scene, GeometryList& out) {
      printf("templateReader::geometry_engine(), do something clever here.\n");
   }

public:
   static const Description description;

   templateReader(ReadGeo* geo, int fd) : GeoReader(geo) {
      printf("templateReader::ctor()\n");
   }
};

static bool test(int fd, const unsigned char* block, int length) {
   printf("templateReader::test() return true if file is correct type\n");
   return true;
}

static GeoReader* build(ReadGeo* op, int fd, const unsigned char* b, int n) {
   printf("templateReader::build()\n");
   return new templateReader(op, fd);
}

const GeoReader::Description templateReader::description("template\0", build, 
test);


On May 20, 2011, at 1:58 AM, Buddly wrote:

> Sorry, you're right it will be easier... Here is my code :
> 
> 
> Code:
> using namespace DD::Image;
> using namespace std;
> 
> class tanReader : public GeoReader
> {
> 
> protected:
> 
>    ReadGeo * geo;
>    void _open() {}
> 
> public:
> 
>    tanReader(ReadGeo* i);
>    ~tanReader() {}
>    void geometry_engine() {}
>    static const Description d;
> };
> 
> static GeoReader* buildGeoReader(ReadGeo* i, int fd, const unsigned char* 
> block, int length)
> {
>     return new tanReader(i);
> }
> 
> const GeoReader::Description tanReader::d("tan\0", "TAN Reader", 
> buildGeoReader);
> 
> tanReader::tanReader(ReadGeo* i) : GeoReader(i)
> {
> 
> }
> 
> 
> 
> I compile this with gcc 4.1.2 and when I load the tanReader.so in Nuke6.2v4, 
> it keeps fail with " ....tanReader.so: plugin did not define tanReader"
> 
> 
> 
> Jeremy
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to