THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/01/2005 at 03:33, xxxxxxxx wrote:
hi, nice to see someone how takes care on CBs.
perhaps this code could help you, but the values (output by console) seem to be invalid, but the amount of CBs is counted correct !!! i don´t know how to read their containing values correctly, and nobody on this forum answered me, yet :°-(
code:
--------------------------------------------------
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <c4d.h>
class SMDFilter : SceneSaverData
{
public:
virtual LONG Save(PluginSceneSaver *node, const Filename &name, BaseDocument *doc, LONG filterflags);
static NodeData *Alloc(void) { return gNew SMDFilter; }
};
LONG SMDFilter::Save(PluginSceneSaver *node, const Filename &name, BaseDocument *doc, LONG flags)
{
doc = GetActiveDocument();
BaseObject *obj = doc->GetActiveObject();
if(obj)
{
//Polygoncount
char polybuffer [33];
GePrint("all Vertices: ");
GePrint(itoa(static_cast<PolygonObject *>(obj)->GetPointCount(),polybuffer,10));
//Claudebonet test
BaseTag *tag = obj->GetFirstTag();
int i=0; int count;
char ibuffer [33], cbbuffer [33];
while(tag->GetType() == Tclaudebonet)
{
VariableTag *gtag = (VariableTag * )tag;
Real *cnt = (Real* )gtag->GetDataAddress();
//count = sizeof(cnt) / sizeof(cnt[0]);
count=0;
LONG anz = cnt[count];
while(anz != NULL)
{
count++;
anz = cnt[count];
}
//CBs output
GePrint(itoa(i,ibuffer,10));
GePrint(itoa(count,cbbuffer,10));
//zum nächsten Tag gehen
tag = tag->GetNext();
//CBs count
i++;
strcpy(ibuffer,"");
strcpy(cbbuffer,"");
}
}
else GePrint(" - no object");
return TRUE;
}
Bool RegisterSMD(void)
{
if(!RegisterSceneSaverPlugin(1111111,"SMDex",0, SMDFilter::Alloc, EXECUTION_RESULT_OK, 0, NULL)) return FALSE;
return TRUE;
}
-----------------------------------
cheers, christian