Jump to content

stop-motion effect


Recommended Posts

Hi all!

Still pretty new to Houdini and as an exercise I was trying to make a bunch of copied boxes change their position in world Y on every third frame using a stamp on the Copy SOP.

What I want to see happen is the boxes get translated randomly in world Y every three frames. For the frames that don't get evaluated I want the boxes to stay in their current (randomized) positions and this is what I can't seem to make happen.

Using an IF expression and modulus seemed like a good path. As an example, in the Value Field I created a variable called "move" and for the Value entered

if($F % 3 == 0, rand($PT * $F), $TY)

I then set the TZ component on the box's Xform SOP to

stamp("../copy1", "move", 0)

Problem is, the boxes return to their default positions on the frames where IF is false. I tried "chf("./ty", $F - 1)" in place of $TY in hopes that I could grab the value for $TY but no go.

I hope all the above is clear, and I hate to ask what I fear is a very basic question, but I am stumped!

Any suggestions would be appreciated!

Link to comment
Share on other sites

Something like this? :

in y-channel of your boxes

$FF-($FF%3)

$FF will push the boxes up

-($FF%3) is your offset.

If you wanted you could add a stamp:

+ stamp(..) is a per box offset in y

hmm, rereading what you want... Are you actually trying to accumulate those random y values?

kinda like:

box 1 at frame 1 is at Y value 2,

box 1 at frame 2 is at Y value 2,

box 1 at frame 3 is at Y value (2 + 8 = 10),

box 1 at frame 4 is at Y value 10,

box 1 at frame 5 is at Y value 10,

box 1 at frame 6 is at Y value (10 + 3 = 13),

box 1 at frame 7 is at Y value 13,

...

with "8" and "3" being random numbers?

If that is the case you are accumulating and effectively require a simulation or a feedback loop. You can either do that with a sopsolver, a particle system or a foreach sop. (sopsolver would be my preferred way personally).

Edited by pclaes
Link to comment
Share on other sites

hmm, rereading what you want... Are you actually trying to accumulate those random y values?

Hi pclaes,

Thanks so much for the response! I want the boxes to randomly change position in Y on every other frame, so with $F % 2 = 0:

box1 at frame 1 stays put

box1 at frame 2 jumps to a random position in Y

box1 at frame 3 stays in the position it was randomly moved to at frame 2

box1 at frame 4 jumps to a random position in Y

box1 at frame 5 stays in the position it was randomly moved to at frame 4

etc.

Does that make better sense? The accumulation ideas will be good for future study, thanks! And gotta say, the training DVD you created for 3DBuzz is fantastic, I hope you have more in store!

Link to comment
Share on other sites

ah, that makes it easy. Just put the rand($FF-($FF%2)) into your y channel.

This will change the seed for the rand expression every 2 frames.

Video tutorials... might do them again at some point, but tricky to make time for them at the moment. I'm sharing scene files of projects/tests that I'm working on and writing some comments in them, which is a bit more straightforward and equally fast if not faster for intermediate/advanced users to learn from, but might get lost in time. Perhaps when I'm inbetween jobs.

Link to comment
Share on other sites

ah, that makes it easy. Just put the rand($FF-($FF%2)) into your y channel.

This will change the seed for the rand expression every 2 frames.

That's closer (at least they all move every other frame), but they all move together now. I tried adding * $PT at various places in the expression but that seems to cancel out the "every other frame" part.
Link to comment
Share on other sites

Are your point numbers changing? Are you using particles?

If so, you might want to use $ID instead of $PT.

what about: rand(($FF-($FF%2))+$PT)

Got it! Just had to get the parentheses in the right place so it would evaluate in the right order.

rand(($FF - ($FF % 2)) * $PT )

pclaes, any reason you chose to use $FF instead of $F? I plugged both in and they both work fine.

Thanks again for the help!

Edited by etudenc
Link to comment
Share on other sites

just habit really... $FF is floating point, it helps to evaluate subframes. I more often deal with floating point than with integers. If I need it as integers I can still cast it int(...) .

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