iam83 Posted July 24, 2017 Share Posted July 24, 2017 Hi everyone, I'm learning VEX in Houdini (as probably everyone here). Recently I tried to recreate a float Attribute in Point Wrangler using VEX. My attribute was a simple math: @ptnum / @numpt When I create this with the Attribute Create node it works fine. But if I do the same in the Point Wrangler it doesn't. I'm trying to realise why not because "logically" it should work. Obviously, I'm missing something there. Please see the attached screenshots. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
fsimerey Posted July 24, 2017 Share Posted July 24, 2017 (edited) It's because @numpt is an integer in the division. Use the function float() to convert integer to float. f@ramp = @ptnum / float(@numpt); But if you want a full ramp from 0 to 1 use this expression f@ramp = @ptnum / float(@numpt - 1); Edited July 24, 2017 by fsimerey Quote Link to comment Share on other sites More sharing options...
iam83 Posted July 24, 2017 Author Share Posted July 24, 2017 1 minute ago, fsimerey said: It's because @numpt is an integer in the division. Use the function float() to convert integer to float. f@ramp = @ptnum / float(@numpt); Thanks a lot! God knows, I tried that before too but for some reason it didn't work either. Just tired it now and it does work :). Magic :). 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.