THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/03/2003 at 02:21, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.100
Platform: Windows ;
Language(s) : C++ ;
---------
Hi there, I just started to code plugins. I wanted to write one which loads a .c4d-file into the actual document by pushing a button.
First I tried to do it as an ObjectData Plugin with that code in Init() function:
Bool DummyObject::Init(GeListNode *node)
{
BaseObject *op = (BaseObject* )node;
BaseContainer *data = op->GetDataInstance();
Filename file = GeGetPluginPath()+ Filename("Dummy.c4D");
BaseDocument* bdoc=LoadDocument(file,TRUE);
SetActiveDocument(bdoc);
InsertBaseDocument(bdoc);
return TRUE;
}
But so I could only open the Dummy.c4d as a new document. I tried the same using that code:
Bool DummyObject::Init(GeListNode *node)
{
BaseObject *op = (BaseObject* )node;
BaseContainer *data = op->GetDataInstance();
Filename file = GeGetPluginPath()+ Filename("Dummy.c4D");
LoadFile(file);
return TRUE;
}
Here Cinema broke down and I got an access violation anywhere after loading the file.
Is there a way to do that more elegant and working?
Thanks