HDK : Accessing a SIM_Object's GU_Detail

   1315   0   0
User Avatar
Member
30 posts
Joined: Oct. 2011
Offline
I'm starting to get my feet wet a bit, but need some guidance on reading attributes better from a RBD_Packed_Object node from Dops. Basically here I want to receive the point “name” attrib on first packedObject, from a Sop node referencing a dopnet. I'm able to get an output using:
//inside cookMySop(...
const SIM_Object *simobj = simobjects(i); // i is a RBD_Packed_Object Node
const SIM_Geometry *geo = simobj->getGeometry();
GU_DetailHandleAutoReadLock sourcegdl(geo->getGeometry());
const GU_Detail *simobjgdp = sourcegdl.getGdp();
GA_ROHandleS h(simobjgdp, GA_ATTRIB_POINT, "name");
const char *string_value = h.get(impactdata->getPrimitiveNumber( 0 ));
std::cout << string_value << std::endl;
My question is if there is a better way of retrieving attributes from a RBD_Packed_Object or a cleaner way of accessing a SIM_Objects gdp? I feel like I'm going about getting the GU_Detail wrong.

Cheers
Edited by AlexLombardi - Aug. 26, 2016 19:03:49
  • Quick Links