Jump to content

Different starting frame in the sequence for sprites


ITdreamer

Recommended Posts

Hello

I have a sequance of 100 images, which can be looped. I use this sequence as a texture for sprites. But what I need to do is I want different starting frame for every single sprite. How can I create this?

Edited by ITdreamer
Link to comment
Share on other sites

hey hey

u could use the expression "wrap" in combination with padzero

so the wrap will

wrap ($F, 5, 10) : Creates a sawtooth function between 5 and 10

padzero(5, 126) = 00126

so u could have something like padzero (4, wrap ($F+(rand ($ID)*50), 1,100))

therefor u can have padding with a sawtooth iteration through ur sprite.

hope this helps

Link to comment
Share on other sites

But where I need to write this expression? If I try to write it in SHOPs, in the material's path to the texture it doesn't understand $ID.

Hey hey

This seemed to work for me

$HOME/Downloads/Tolpa/images/wlk000_Dave/lr_color/lr_CW_Dave`padzero (4,wrap ($F+ (rand ($ID)*100),1,100))`.rat

I quickly built up a scene that does just this :)

hope this helps

:blink:

sprite.hip

Link to comment
Share on other sites

Thanks for your time.

Scene renders. But if you look closely to your render (your sprites are very small and maybe you didn't check that), you'll see that all sprites have the same texture. And it seems to me that this doesn't work. :(

Edited by ITdreamer
Link to comment
Share on other sites

Thanks for your time.

Scene renders. But if you look closely to your render (your sprites are very small and maybe you didn't check that), you'll see that all sprites have the same texture. And it seems to me that this doesn't work. :(

mmm, im not sure I agree, with the sequence not working.

try deleting some files from the sequence, they seem to disappear out of the render,

thats how i did the test.

as for the scale, yeah, I just quickly built the scene to show u how point attributes can be passed to the sprite procedural, allowing u to override material attributes on a per particle basis.

let me know if deleting the files didnt work for u :)

Link to comment
Share on other sites

I've created few point attributes which create a path to the texture with a different starting frame. And than it overrides SHOPs attributes.

This way is good, but not so flexible. For example, if I want more than 5 kinds of textures, I need to recreate a script little bit.

So, now I am working on a python SOP, which will do everything automatically with any number of textures.

I'll post the results.

Link to comment
Share on other sites

  • 1 year later...

I've created few point attributes which create a path to the texture with a different starting frame. And than it overrides SHOPs attributes.

This way is good, but not so flexible. For example, if I want more than 5 kinds of textures, I need to recreate a script little bit.

So, now I am working on a python SOP, which will do everything automatically with any number of textures.

I'll post the results.

Hi, ITdreamer,

I'm trying to achieve the same thing. have a sprite seq start depending on $ID.

I couldn't figure it out. Could post a simple scene? I'm kinda new to houdini

thanks

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