Jump to content

using len() in switch node?


Recommended Posts

hey all, 

inside a sop solver on a switch node I'm trying to get the length of a string array and multiply it with another channel

right now the solver is overcopying objects: 

image.png.a0507fea445830a6b06fc9ff8c7ea154.png

I was able to get this to work comparing the values of two float channels but I can't get it to work with a string array since len() doesn't show up in that context? I tried reading the manual on vex contexts and cvex but it's a bit confusing. which context is the switch node parameter in? is it in sop context because the node was created in a sop solver or is it somewhere else entirely because I'm typing in a parameter textbox?

 

image.thumb.png.7bf083ad99209545571ac76700f42cdb.png

Edited by rbesca
Link to comment
Share on other sites

  • rbesca changed the title to using len() in switch node?

expressions in parameters are by default Hscript expressions, optionally you can switch to Python, which can provide more power (at the expense of speed and amount of code) depending on the task

you can also precompute value as an attribute using VEX and then reference in the parameter using one of the Hscript expression functions (detail(), prim(), point(), vertex())

 

 

  • Like 1
  • Thanks 1
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...