Jump to content

get all the available point attributes?


Recommended Posts

Hi guys:

 

  To get a point attribute's info, normally it's going to be like the following:

gdp->findAttribute(GA_ATTRIB_POINT, attr_name);

Is there an similar method to do something like:

gdp->findAllAttribute(GA_ATTRIB_POINT);

?

 

If not, what's the best way to list all the available point attributes on a point in hdk?

 

thanks a lot!

 

(I tried going through the old posts roughly, but seems there is no answer for this yet. Apologize in advance if I missed it :) )

 

-ling

 

 

Link to comment
Share on other sites

thanks for the reply edward.

 

it kinda worked:

    for (GA_AttributeDict::iterator it = gdp->getAttributeDict(GA_ATTRIB_POINT).begin(GA_SCOPE_PUBLIC); !it.atEnd(); ++it)
        {
        const GA_Attribute *attrib = it.attrib();
        cout << "Point attr: " <<attrib->getName() << endl;
        }

but it seems not getting all the point attributes?

In my test case, there are a few points scattered from a cube, and then I added a custom attrib named 'id', which is the same as $PT.

 

So ideally it should print out "P" AND "id", however, it only prints out "P" with the above code.. any idea would be really appreciated.

I am in hdk 12 if this makes any difference.

 

 

thanks

-ling

Edited by Linghaoli
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...