Jump to content

Deleting Attributes


Recommended Posts

Not sure about the custom variable mappings but you can delete attributes with the destroy methods

eg

gdp->destroyPointAttrib("Cd",sizeof(float)*3,GB_ATTRIB_FLOAT);

Thanks Simon,

One follow up question, if you reqiure the size and type of attribute in order to delete it,

is there a way to determine what the size and type is of an incoming attribute?

I'm hoping to get similar behaviour to the delete sop's "Delete Attributes" parameter

I'm digging through

doxygen at the moment, but I'm coming up a bit short.

findAttrib() maybe?

Many thanks

L

Link to comment
Share on other sites

The only time I haven't know the size before hand is when dealing with attribute pairs, in that case there is another destroy function which doesn't need the size just the name.

gdp->destroyPtIndexPairAttribute("warpCaptp");

If that doesn't help I'm afraid I don't know of a way.

Link to comment
Share on other sites

Figured out how to get the type and size of an attribute.

Thought I'd share so everyone can benifit:

GB_Attribute *attrib = gdp->pointAttribs().find(parmVal);

if(attrib!=0){

int offset = gdp->pointAttribs().getOffset(attrib);

GB_AttribType type = attrib->getType();

int size = attrib->getSize();

L

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...