On 03/01/2013 at 13:54, xxxxxxxx wrote:
Cinema 4D Version: R13
Platform: Mac ;
Language(s) : C++ ;
I've been trying to copy the descriptions of attributes off an object. It seems to be working fine with single level DescIDs, so integers, floats, etc. But it won't work with attributes with more then one level, like a vector.
AutoAlloc<Description> desc; BaseContainer* bcdesc; op->GetDescription(desc, DESCFLAGS_DESC_0); DescID relpos(ID_BASEOBJECT_REL_POSITION);//position vector of an object bcdesc = desc->GetParameterI(relpos, NULL);//This works //DescID relposx(ID_BASEOBJECT_REL_POSITION,VECTOR_X);// x position of an object //bcdesc = desc->GetParameterI(relposx, NULL);//This doesn't work, it crashes Cinema
So I can get the entire vector, but I can't get just the X,Y, or Z out of it. If I run the commented code then Cinema crashes right away. From my tests it seems like it is because it has two levels. If I popped the top level off the second example it would correctly return the entire vector again.
I saw this function:
#### Bool GetSubDescriptionWithData(const DescID& did, const AtomArray& op, RESOURCEDATATYPEPLUGIN* resdatatypeplugin, const BaseContainer& bc, DescID* singledescid)_<_h4_>_
But I haven't been able to get that to work yet, and I'm not sure if that's what I need anyway. If anyone has any ideas I'd appreciate it.