Jump to content

VOPS: pass an string expressions into a network?


pushpathadam

Recommended Posts

Hi,

is there a way to pass an string expression like $PT*5 through a parameter into an attribute inside a VOP network?

I tried a parameter VOP but it doesn't seem to evaluate .

I'm trying to get the same functionality as in you'd see in a point sop parameters

like position.

There's a thread from 2004 that says you can't

http://www.sidefx.com/index.php?option=com...vops+attributes

Is this still true?

thanks

Tom P

Link to comment
Share on other sites

Hey Tom,

How are you? :)

I'm afraid that local variables like $PT are not supported for VEX SOP parameters - although technically they *should* be because VEX SOPs work across points. I hope SESI still have this as an RFE on their books.

The workaround option is to precede the VEX SOP with an AttribCreate (which does have access to $PT) and create a point attribute of the same name as the VEX parameter.

Good luck,

Jason

vex_lvar_workaround.hip

Link to comment
Share on other sites

The problem is that in order to properly evaluate $PT, each point iteration needs to modify the PT local variable and the variables need to be re-evaluated. VEX evaluates points in arrays within the VEX engine, which needs parameters evaluated before it starts running. Having VEX run one point at a time would be prohibitively expensive.

Link to comment
Share on other sites

Hi Jason,

I'm doing well :)

Intersting...I can see from the next/previous post the logic of why they don't support it but yeah its would be a nice RFE. I was looking at an OTL to package a simple setup with only a few exposed attributes for some new users. However I still wanted to allow all the per point control that makes SOPS so cool.... Oh well back to drawing board

Thanks for the tip and happy holidays!

Tom P

Hey Tom,

How are you? :)

I'm afraid that local variables like $PT are not supported for VEX SOP parameters - although technically they *should* be because VEX SOPs work across points. I hope SESI still have this as an RFE on their books.

The workaround option is to precede the VEX SOP with an AttribCreate (which does have access to $PT) and create a point attribute of the same name as the VEX parameter.

Good luck,

Jason

Link to comment
Share on other sites

Intersting...I can see from the next/previous post the logic of why they don't support it but yeah its would be a nice RFE. I was looking at an OTL to package a simple setup with only a few exposed attributes for some new users. However I still wanted to allow all the per point control that makes SOPS so cool.... Oh well back to drawing board

I wonder if there is something you can with a: eval(chsraw("../my_otl_parameter_with_pt") - which might allow a $PT to exist on the OTL parm interface and delay the evaluation of the $PT until the node is executed

Link to comment
Share on other sites

Guest xionmark
Yes! just tried that out. Not in vex/vops but in an OTL containing a bunch of attribute_creates.

Instead of ch("../to my otl parameter") eval(chsraw("../to my otl parameter")).

This is sweet... does the job just right ...thanks Jason!

-Tom

Hey Tom!

How's it going man? Long time!

I'm curious if there's a performance hit using this method as opposed to setting the point number as an attribute first, thus letting the VEX engine run faster? ... Just guessing, haven't made the comparison myself but was wondering if you had done so.

Take care,

Mark

Link to comment
Share on other sites

Hi Mark,

I'm doing well..Its been a while since Beowulf :)

I hadn't tried it that way. I was looking at a front end for an external instancing tool. Just wanted to simplify initializing attributes but not loose the ability to use expressions like

you could with an attribute create. I'll have to run some biger data through it and see if there's a speed or memory hit.

cheers

Tom P

Hey Tom!

How's it going man? Long time!

I'm curious if there's a performance hit using this method as opposed to setting the point number as an attribute first, thus letting the VEX engine run faster? ... Just guessing, haven't made the comparison myself but was wondering if you had done so.

Take care,

Mark

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