neokovago Posted February 22, 2018 Share Posted February 22, 2018 Hello magicians! I'm doing a project where I have to loop textures on multiple goes. Basically a sprite randomization with textures, but I can not figure out a way how to loop the texture sequence like padzero does. I have to do it in VOP or vex, since the shader expects a specific filename as a map on the geo. Sadly, I can not upload a scene file, but hopefully my problem is understandable. Thanks for reading it. Cheers Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted February 22, 2018 Share Posted February 22, 2018 Probably have a look at the modulo and sprintf functions/vops modulo is useful for looping time like: $F % 3 give you 1, 2, 3, 1, 2, 3, 1, 2, 3.... instead of the straight count. So in vex just do @Frame%3 or in vop there is a modulo node. sprintf allows for string formatting kind of C style: sprintf('%04d', @Frame) is like padzero(4, $F) expression. In vop there's the print node that allows similar string formatting. 3 Quote Link to comment Share on other sites More sharing options...
neokovago Posted February 22, 2018 Author Share Posted February 22, 2018 1 minute ago, jkunz07 said: Probably have a look at the modulo and sprintf functions/vops modulo is useful for looping time like: $F % 3 give you 1, 2, 3, 1, 2, 3, 1, 2, 3.... instead of the straight count. So in vex just do @Frame%3 or in vop there is a modulo node. sprintf allows for string formatting kind of C style: sprintf('%04d', @Frame) is like padzero(4, $F) expression. In vop there's the print node that allows similar string formatting. thank you! just what i needed. so simple (as always). thanks again! 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.