GA_BlobHandle in HDK12

   1832   2   1
User Avatar
Member
27 posts
Joined: Nov. 2008
Offline
hi,

I'm looking at HDK12 and specifically writing GA_BlobData.

I was trying to follow the example on the bottom of this page regarding GA Blind Blob Data.
http://www.sidefx.com/docs/hdk12.0/hdk_ga_porting.html [sidefx.com]

Except I can't seem to find GA_BlobHandle class like in the example. The closest thing I found GA_BlobRef except I can't quite work out how to use it.

if GA_BlobRef is indeed a subsitute for GA_BlobHandle then it'd be great if someone can provide an example of how to set/read/write GA_BlobRef to GA_Offset point please.

Thank you very much for your help in advance,
User Avatar
Staff
2591 posts
Joined: July 2005
Offline
simayi
hi,

I'm looking at HDK12 and specifically writing GA_BlobData.

I was trying to follow the example on the bottom of this page regarding GA Blind Blob Data.
http://www.sidefx.com/docs/hdk12.0/hdk_ga_porting.html [sidefx.com]

Except I can't seem to find GA_BlobHandle class like in the example. The closest thing I found GA_BlobRef except I can't quite work out how to use it.

if GA_BlobRef is indeed a subsitute for GA_BlobHandle then it'd be great if someone can provide an example of how to set/read/write GA_BlobRef to GA_Offset point please.

Thank you very much for your help in advance,

I've fixed the HDK documentation for tomorrow's daily build.

The ATIBlob class stores smart pointers to the hashable blob objects. GA_BlobRef is the class (typedef) for the smart pointer to the GA_BlobData object.

To store a blob into the attribute:
// Create a shared pointer to the blob object you want to insert into the
// attribute.
GA_BlobRef blob(new BlobDataSubClass(..));

// Store the blob at the given offset
aif->setBlob(blob, offset);


To get a blob for a given offet:
GA_BlobRef blob = aif->getBlob(offset);
if (blob)
do_something(blob);
else
no_blob_stored_at_given_offset(offset);


If this is unclear, please let me know and I can try to improve the documentation.
User Avatar
Member
27 posts
Joined: Nov. 2008
Offline
thank you so much for the prompt reply.

your explanation is clear, i changed aif->setBlob(blobRef, offset) to aif->setBlob(a, blobRef, pOffset)… i take it that it's the same thing…

thanks, :-)


GA_Attribute *a = someAttr.getAttribute();
const GA_AIFBlob *aif = a->getAIFBlob();

GA_Offset pOffset = gdp->appendPointOffset();

GA_BlobRef blobRef( new SomeBlob() );
aif->setBlob(a, blobRef, pOffset);
  • Quick Links