View Full Version : attribute existence

09 September 2005, 10:39 AM
hi all,
I am trying to use attributeExists to find out if the attribute is there in the scene. Such as:

attributeExists "noise" "ramp1";

it returns 1, that works fine, however if i do this:

attributeExists "colorEntryList[1].position" "ramp1";

it returns 0 even if it exists under the ramp node.

I guess its because of the position attribute is hidden deeper than other attribute, which cannot be seen by the script. I have found out the way to display the number of entries in colorEntryList. However, it does not mean that all entry index starts with 0. Thus, I just need to find out a way to check if the colorEntryList[0] exist under the ramp node.

Thanks in advance.....


09 September 2005, 09:38 PM
int $pExists = `attributeExists "colorEntryList.position" "ramp1.colorEntryList"` ;
int $cExists = `attributeExists "colorEntryList.color" "ramp1.colorEntryList"` ;


CGTalk Moderation
09 September 2005, 09:38 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.