Jump to content

findattribval VOP - what it returns ?


Recommended Posts

Hi.

There are series of nodes in Vop Sop:

-findattribvalindex - return a element id while you point an index;

- findattribvalcount - return a count of elements that have the attribute value match to desired( i don't get why it's output called elemId);

- findattribval - and what this node return ??

Here a simple example. Count of red prims - 6.

findattribvalcount return - 6 Ok

findattribvalindex - if you scrub the index slider return 0,1,2,3,4,5 - all prims numbers - Ok

findattribval - ??

jb_findByAttrval.hipnc

Link to comment
Share on other sites

findattribvalindex - returns element id of the i-th element where and attribute value equals the search value (i is index)

findattribvalcount - returns a number of elements whose attribute value matches the search value

findattribval - returns element id of the first element where and attribute value equals the search value (like findattribvalindex with index 0)

actually findattribvalindex and findattribval calls just different definition of the same VEX function called findattribval()

so maybe if you don't need to specify index it will perform faster and that's why you have both options

Link to comment
Share on other sites

Thanks Tomas.

You right, in findattribval node function call without last argument (i forgot that it's possible to view VEX code). Seems it cause to return first match id like you say.

But anyway it can be more precisely pointed what it return in Help.

P/s/ There are no definition of "findattribval" function in the VEX help reference.

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