Lister Posted April 21, 2017 Share Posted April 21, 2017 Quick question, I was watching Jeff Wagner's webinar on the changes to nodes in 16 and at the 15:04 mark he starts discussing the new Point node. In the drop down options for the VEXpression field there are a number of options, such as Pass Through, Constant Value, etc. There is a Multiply by Constant Value but no Divide by, and if I try to write a VEXpression and use a division sign it does not seem to evaluate. For instance if I wanted to create a gradient of color along a line, I would try to use set(value.r + (@ptnum/@numpt), value.g, value.b) but I would just get values of 0,0,0 for every point. I can do the @ptnum/@numpt division in a separate Attribute Create node but not in the VEXpression field of the Point node itself. Can you not use division in VEXpressions? Quote Link to comment Share on other sites More sharing options...
woodenduck Posted April 21, 2017 Share Posted April 21, 2017 Have you tried casting @ptnum and @numpt to floats before dividing? (float)@ptnum / (float)@numpt I think VEX will treat them as integers and not divide correctly otherwise. 1 Quote Link to comment Share on other sites More sharing options...
Lister Posted April 21, 2017 Author Share Posted April 21, 2017 8 minutes ago, woodenduck said: Have you tried casting @ptnum and @numpt to floats before dividing? (float)@ptnum / (float)@numpt I think VEX will treat them as integers and not divide correctly otherwise. Brilliant, thank you, that worked out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.