Jump to content

accessing a Details Attrib from the 2nd Input??


Recommended Posts

Hi I have been trying to access the details attrib which I created to store the Total number of points..

I want to access this inside VOPs but am having some issues..

I want to use this value as an input to the For loop's end value..I did manage to get the Value but when I plug it into

the for loop's end value input it errors out saying bad parameter..

I tried accessing the value using Channel reference as well as by the npoints() expression but the problem

remains..

could anyone throw out a hint?

Also, while i'm at it, let me ask one more question as well :)

is it possible to get the Attributes in 1,2,3 inputs all at once just like from the main (0) input??

for instance: can I get all the P values inside VOPs from say the 2nd input of the VOP SOP together instead of having to specify

the point number specifically??

here's the HIP file..

thanks :)

test.hip

Edited by bhaveshpandey
Link to comment
Share on other sites

hey thanks Rick...

I already tried it out with the details() expression..and it works too but

for some odd reason, the for loop is not working with that value..thats why i attached a print VOP to it to see if its working..

could you tell me if the For Loop was indeed working on your machine and the print VOP outputted some non zero value??

screencap1.jpg

Edited by bhaveshpandey
Link to comment
Share on other sites

Your problem is that you put an expression as the default value, and that expression is fine if you were to use a Constant VOP to store the data, but that expression errors out at the SOP level because if you unhide the parameter you'll see that it's searching for the SOP with the data at the object level.

If you want the number of points from the 2nd input I'd just suggest using the parameter, with a default value of 0, then put in an expression along the lines of npoints(opinputpath(".", 1)). This gets the number of points from operator connected to the 2nd input.

Link to comment
Share on other sites

hey Graham! thanks a ton man..

thats what I needed..however I cant understand two things..

1) what does this expression mean:

npoints(opinputpath("../vex_numthreads", 1))

the npoints and opinputpath is understood but why did we put in vex_numthreads in there?

and

2) why was it needed that we added a parameter node with a default value of 0?

thanks a lot again for the solution :)

cheers

Link to comment
Share on other sites

I have no idea about the expression pointing to the vex_numthreads channel because I don't see that in my hip file. No idea where it came from.

The idea was that if you are going to use a Parameter VOP it's generally a bad idea to have an expression in there that is using a relative path because it's always going to have issues. Personally I'd use the constant, or just put the expression right into the for loops parameter.

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...