Jump to content

expression help -looping?


zveris

Recommended Posts

I have a question about expression

I wan to change uv positions with image map, and to do that on per frame base. So if I do expression $MAPU +(tex("mysequence$F.pic" ,$MAPU, $MAPV, r) I'm getting innitial uv possition plus r value of currient frame, which is fine for the first frame, but not for the rest of the frames, where I would like to have previous frame uv possition plus value.

So how do I write this expression?

Help would be realy appreciated

Aivaras

Link to comment
Share on other sites

Look into using the Trail SOP to get a previous frame, and then look into using the point() expression to reference those points. Unfortunately the Trail SOP doesn't allow you to NOT output the current geometry too. I've often wished for the Trail SOP to just allow you to get the past frames even just for my own OnionSkinning purposes.

Anyhow, it looks like a good way to remove the current frame is to use the GroupCopy SOP. Attached is a simple hipfile to so that.

This little function would be great to be made into an OTL..

trail_previous_frame.1.zip

Link to comment
Share on other sites

Thanks Jason,

this is a nice trick for onion skinning.

But I dont think it helps in my case. Your net allows to look get the data from the previous frame, but I still don't know how to compute the data.

Consider this - on fr1 I have u and v(UV0) coordinates for a point. I displace those coordinates using r value of the image at those uv coordinates and result is UV1.So we go to frame two where new texture map will give the next displacement value, but the problem is that $MAPU $MAPV in a point sop will not read UV1 but UV0, which gives incorect result.

My point is - I have a seequence of images describing motion not in absolute meening but incrementaly , therefore I want uv's to move to new possition to get next motion increment.

I hope it makes sense, and I hope somebody can come with some idea for it, I'm getting totaly out of my mind here.

zveris

Link to comment
Share on other sites

Ah, I see. What you're wanting to do ultimately is "simulation" - where changes are cumulative. This is doable with mild hacks and it almost always entails writing out the frame and reading that same frame back in on the next frame.

ReadFrame

|

MoveStuffAbout

|

WriteFrame

You can build in a SwitchSOP in there to output the rest/initial position at Frame=1 ($F=1) and it goes quite smoothly.

Take a look at the LoopSOP that was submitted to od[force]. This uses a technique like this.

Hope it helps,

Jason

Link to comment
Share on other sites

Bring your geometry into POPs and append an Attribute POP. Let's say you called it "uv" as the name and "UV" as the Local Variable. Then put your starting uv expressions into the Default parameter. In the Value parameter use $UV1+0.1 and $UV2+0.1. Now you should see the values changing every frame in the geometry spreadsheet. Check out the attached file.

pop_attrib.hip.gz

Link to comment
Share on other sites

thanks edward, that seemes to work. Indeed, if to check spreadsheat the values are adding nicely up and all. So it is fine. Thank you very much.

Just one last question and I feel stupid to ask - why I cant read thosse new uv's to point sop? Which ever way I try - feeding as a second input in point sop, transfering attribure, making ch expression - nothing happens, although I see in spread sheat nicely animated uv attributes in popnet, they seem to be not transferable to poin sop.

Thanks again.

zveris

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