Isotropix Forums

Get all attribute of any object except Hidden & Private ones

Clarisse Scripting related topics

Get all attribute of any object except Hidden & Private ones

Unread postby vishumish » Wed Oct 21, 2020 8:12 am

Hi,

I want to query only those attributes which are editable by the user. I think listing all the attributes which are visible in the attribute editor is the way to go. And to do that I have to filter out OfAttr.FLAG_HIDDEN & OfAttr.FLAG_PRIVATE from all the attributes.

Can someone please tell me a way to do that? I couldn't find any way to filter certain attributes or is there any other way to list all the "user editable" attributes?

Following is a snippet for your reference :

python code

item = ix.get_item("project://camera/top")
for i in range(item.get_attribute_count()):
attr = item.get_attribute(i)
print attr.get_full_name(), attr.FLAG_HIDDEN


I want a way to either add mask on item.get_attribute_count(mask) method to exclude certain attributes or a way to check True or False state of attr.FLAG_HIDDEN in a condition?
vishumish
 
Posts: 18
Joined: Mon Jan 27, 2020 11:38 am

Re: Get all attribute of any object except Hidden & Private

Unread postby anemoff » Thu Oct 22, 2020 9:36 am

Hi,

You can simply use the following OfAttr methods:
- is_hidden()
- is_private()

These methods are helpers that check the presence of FLAG_HIDDEN and FLAG_PRIVATE.

Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 362
Joined: Wed Jan 13, 2016 10:10 am

Re: Get all attribute of any object except Hidden & Private

Unread postby vishumish » Thu Oct 22, 2020 2:55 pm

oh, that's so ignorant of me.. thanks anemoff :)
vishumish
 
Posts: 18
Joined: Mon Jan 27, 2020 11:38 am


Return to Scripting