Jump to content
Sign in to follow this  
rbesca

using len() in switch node?

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×