On 24/06/2015 at 12:05, xxxxxxxx wrote:
Hi,
I'm still using a temporary internet connection. So I can't reply back to you about this.
But I do have some code for handling PoseMorphs and Xpresso that might possibly help you out.
This is R13 code:
//This is an example of loading a PoseMorph tag into a node in the xpresso editor
//Then adding the first morph's strength output port in the xpresso node
//PoseMorph tag required headers
#include "..\..\..\resource\modules\ca\res\description caposemorph.h"
#include "..\..\..\..\resource\_api\c4d_libs\lib_ca.h"
//GvCall required headers
#include "c4d_graphview.h"
#include "c4d_operatorplugin.h"
//A custom macro for getting the node's data
#define GvCall(op,fnc) (((GvOperatorData* )op)->*((OPERATORPLUGIN* )C4DOS.Bl->RetrieveTableX((NodeData* )op,1))->fnc)
Bool SimplePlugin::Execute(BaseDocument *doc)
{
PolygonObject *obj = (PolygonObject * ) doc->GetActiveObject();
if(!obj) return FALSE;
//Get the xpresso and PoseMorph tags on the object
XPressoTag *xTag = (XPressoTag* )obj->GetTag(Texpresso, 0);
if(!xTag) return FALSE;
CAPoseMorphTag *morphTag=(CAPoseMorphTag* )obj->GetTag(Tposemorph);
if(!morphTag) return FALSE;
//Get the xpresso's master container
GvNodeMaster *nm = xTag->GetNodeMaster();
//Create a new Object type node
GvNode *morphNode = nm->CreateNode(nm->GetRoot(), ID_OPERATOR_OBJECT, NULL, 120, 200);
//Assign the new node to the morph tag
//This acts like dragging an dropping the morph tag onto the xpresso Object node
morphNode->OperatorSetData(GV_ATOM, morphTag, GV_OP_DROP_IN_BODY);
//Get the morphNode's data
GvOperatorData *od = morphNode->GetOperatorData();
//Get the first morph's strength description and use it to create an output port for it
CAMorph *firstMorph = morphTag->GetMorph(1);
DescID id = DescID(ID_CA_POSE_ANIMATE_DATA, firstMorph->GetID()*ID_CA_POSE_ANIMATE_CNT+ID_CA_POSE_ANIMATE_OFFSET+ID_CA_POSE_ANIMATE_STRENGTH);
LONG didValue = GvCall(od, GetMainID)(morphNode, GV_PORT_OUTPUT, id);
GvPort *port = morphNode->AddPort(GV_PORT_OUTPUT, didValue, GV_PORT_FLAG_IS_VISIBLE, TRUE);
nm->Message(MSG_UPDATE);
EventAdd();
return true;
}
-The Ghost