Jump to content

Texture looping in vex


neokovago

Recommended Posts

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

Link to comment
Share on other sites

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.

  • Like 3
Link to comment
Share on other sites

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!

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...