THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/10/2010 at 08:52, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11.5
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ; XPRESSO ;
---------
Hi,
I have a node with an inport that is crashing and I don´t know why.
Here is some code:
EditNode : public GvOperatorData
{
// Defines super
INSTANCEOF(EditNode, GvOperatorData)
public:
virtual Bool AddToCalculationTable(GvNode *bn, GvRun *r);
virtual Bool iCreateOperator(GvNode *bn);
Bool InitCalculation(GvNode *bn, GvCalc *c, GvRun *r)
{
return GvBuildInValuesTable(bn, ports, c, r, input_ids);
}
void FreeCalculation(GvNode *bn, GvCalc *c)
{
GvFreeValuesTable(bn, ports);
}
Bool Calculate(GvNode *bn, GvPort *port, GvRun *run, GvCalc *calc);
static NodeData* Alloc(void) { return gNew EditNode; }
private:
GvValuesInfo ports;
};
Bool EditNode::iCreateOperator(GvNode *bn)
{
BaseContainer* data = bn->GetOpContainerInstance();
data->SetLong(EDIT_INDEX,0);
if (!data) return FALSE;
return SUPER::iCreateOperator(bn);
}
Bool EditNode::AddToCalculationTable(GvNode *bn, GvRun *r)
{
return (r) && (r->AddNodeToCalculationTable(bn));
}
Bool EditNode::Calculate(GvNode *bn, GvPort *port, GvRun *run, GvCalc *calc)
{
BaseContainer *data = bn->GetOpContainerInstance();
if (!data) return FALSE;
BaseDocument* doc = bn->GetNodeMaster()->GetDocument();
if (!doc) return FALSE;
GvValue* vinport = ports.in_values[EDIT_INDEX]; if (!vinport) return FALSE;
if (!vinport->Calculate(bn, GV_PORT_INPUT, run, calc, 0)) return FALSE; //<- HERE IT CRASHES!
[...]
}
Even when it is the only node in the xpresso editor (I have not set NEEDCONNECTION in the resources) it crashes at the shown function call. Any idea why it crashes? the shown pointers are all valid, I checked in debug mode.
This is in my resources in the ports group:
GROUP ID_GVPORTS
{
LONG EDIT_INDEX {INPORT; STATICPORT; CREATEPORT;}
This happens with all my according nodes so it´s quite grave and I´d need to fix it.
Thanks in advance!
Thanks in advance