On 26/01/2014 at 07:33, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform: Windows ;
Language(s) : C++ ;
---------
I trying to load and run a python script using the example given.
It keeps coming up with FILEERROR = -100 = [FILEERROR_WRONG_VALUE](file:///D:/Users/pgrooff/Documents/pim/c4d/c++%20R15%20sdk/help/pages/ge_prepass/enum_FILEERROR560.html#fileerror_wrong_value9); ???
What am I doing wrong?
case 1000: //do command
{
Filename fn = "test.py";
BaseList2D *op=(BaseList2D* )AllocListNode(ID_PYTHONSCRIPT);
//BaseDocument *doc = GetActiveDocument();
//Int32 error = ReadHyperFile(doc,op,fn,'scrp',nullptr);
Int32 error = ReadHyperFile(nullptr,op,fn,'scrp',nullptr);
GePrint ("error: " + String::IntToString(error)); // always FILEERROR_WRONG_VALUE?
if (op && ReadHyperFile(nullptr,op,fn,'scrp',nullptr)==FILEERROR_NONE)
{
BaseBitmap *ptr=nullptr;
op->Message(MSG_SCRIPT_EXECUTE,&ptr);
//annotations = op->GetDataInstance()->GetString(PYTHONSCRIPT_TEXT);
}
break;
}
Note: I am doing the ReadHyperFile twice to get the FILEERROR more clear.
The script is found, if else a -1 would be given.
Also, I do not know how to define "annotations", String?