On 26/04/2016 at 11:45, xxxxxxxx wrote:
Still not seeing the objects in render:
Header:
// CLASS: V4DObject
class V4DObject : public ObjectData
{
INSTANCEOF(V4DObject,ObjectData)
private:
// Data
// --- This is the list head were the plugin node will be inserted to
AutoAlloc<GeListHead> m_pBranchHead;
String m_String_BranchName;
//pointer to an instance of the plugin node
BaseList2D* m_pBranchNode;
...
CPP File
// NodeData.Init
//*---------------------------------------------------------------------------*
Bool V4DObject::Init(GeListNode* node)
//*---------------------------------------------------------------------------*
{
if (node == nullptr)
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.Init.node");
// Allocate V4DPlant
m_pPlant = NewObjClear(V4DPlant, static_cast<BaseObject*>(node));
if (m_pPlant == nullptr)
return ErrPrt("V4DPlant allocation failed!");
if (!m_pPlant->Init())
return ErrPrt("V4DPlant initialization failed!");
// Establish GeListHead and Node to store Leaf Object (??)
if (m_pBranchHead == nullptr)
return ErrPrt("V4DObject.Init.m_pBranchHead");
if (m_pBranchNode == nullptr)
{
// - Create Master Leaf Object for Render Instances
m_pBranchNode = m_pPlant->CreateLeafObject();
if (m_pBranchNode == nullptr)
return ErrPrt("V4DObject.Init.m_pPlant.CreateLeafObject");
}
// Needed to save the node list
m_pBranchHead->SetParent(node);
// Insert the plugin node into the list
m_pBranchHead->Insert(m_pBranchNode, nullptr, nullptr);
// Allocate dialog to impart and stop growth
m_pDialog = NewObjClear(V4DGrowthDialog);
if (m_pDialog == nullptr)
return ErrPrt("V4DGrowthDialog allocation failed!");
// Set default values
SetDefaults(static_cast<BaseObject*>(node));
m_Bool_RebuildCache = TRUE;
return TRUE;
}
// NodeData.GetBranchInfo
//*---------------------------------------------------------------------------*
Int32 V4DObject::GetBranchInfo(GeListNode* node, BranchInfo* info, Int32 max, GETBRANCHINFO flags)
//*---------------------------------------------------------------------------*
{
// Fill the info structure array; only one element is saved in this example
info[0].head = m_pBranchHead;
info[0].name = &m_String_BranchName;
info[0].id = ID_VINEMA4D_OBJECT;
info[0].flags = BRANCHINFOFLAGS_0;
// Return the number of filled BranchInfo elements
return 1;
}
// NodeData.Copy - Copy data to copied BaseObject
//*---------------------------------------------------------------------------*
Bool V4DObject::CopyTo(NodeData* dest, GeListNode* snode, GeListNode* dnode, COPYFLAGS flags, AliasTrans* trn)
//*---------------------------------------------------------------------------*
{
if (snode == nullptr)
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.CopyTo.snode");
if (m_pBranchHead == nullptr)
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.CopyTo.m_pBranchHead");
if (m_pPlant == nullptr)
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.CopyTo.m_pPlant");
// Get Destination V4DObject and its V4DPlant
V4DObject* dobj = (V4DObject* )dest;
if (dobj == nullptr)
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.CopyTo.dobj");
if (dobj->m_pPlant == nullptr)
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.CopyTo.dobj.m_pPlant");
if (!m_pBranchHead->CopyTo(dobj->m_pBranchHead, COPYFLAGS_0, trn))
return MessageSystem::Throw(GeLoadString(KDZS_ERR_MEMORY), "V4DObject.CopyTo.m_pBranchHead.CopyTo");
return m_pPlant->CopyTo(dobj->m_pPlant);
}
m_pBranchNode is being passed to be set as the link in the Render Instance objects.