THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/03/2006 at 11:26, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.5
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
---------
Hi everybody.
I'm beginning developping little plugins in C.O.F.F.E.E and I experience a problem trying to make a filter plugin which simply writes objects coords of a scene in a file. To do that, I've created a coords_exporter class inherited from the FilterPlugin class and I've registered it in the main() function. But, when I execute my script, Cinema4D crashes after I select the file to write and I really don't know why...
There is my code :
class coords_exporter : FilterPlugin
{
public:
coords_exporter();
GetName();
GetID();
Identify(probe,fname);
Save(doc,fname,obj,mat,env,dialog);
};
coords_exporter::coords_exporter()
{
super();
}
coords_exporter::GetID()
{
return 1000001;
}
coords_exporter::GetName()
{
return "coords_exporter";
}
coords_exporter::Identify(probe,fname)
{
return TRUE;
}
coords_exporter::Save(doc,fname,obj,mat,env,dialog)
{
var object=new(BaseObject);
object=doc->GetFirstObject();
var file=new(BaseFile);
file->Open(fname,GE_WRITE,FILE_DIALOG,GeGetByteOrder());
var pos;
while(object!=NULL)
{
pos=object->GetPosition();
file->WriteReal(pos.x);
file->WriteReal(pos.y);
file->WriteReal(pos.z);
object=object->GetNext();
}
}
main(doc,op)
{
Register(coords_exporter);
}
Could you tell me where I'm mistaking ?