Jump to content
Pancho

Trouble with using the Wedge node

Recommended Posts

What I need to do is render the same frame over and over again, BUT with another sim file.

What I did so far: Use the Wedge node in the OUT context to export one frame of a simulation. This simulation has been executed each time with a different seed, so that the particles were influenced by the same forces, but with  a slightly different end position.

What I need to do now is reload each sim file on the same frame, render it and save it to disk. So far I can't get H to evaluate the File node in a proper way. I want to alter the name of the file with the help of the $WEDGENUM variable, but it doesn't evaluate it correctly. Any ideas what's going wrong?

Cheers

Tom

P.S.: Screenshots 1+2 show the File load node, Screenshot 3 the Wedge node. The channel is set to the file name path.

ScreenShot001.jpg

ScreenShot002.jpg

ScreenShot003.jpg

Share this post


Link to post
Share on other sites

It sounds like you want to be using the File Merge node instead of the File node.

The expression stays similar to what you have, but you must define the merge variable that contains your wedge number.

Example screenshot below.

wedges.PNG

Share this post


Link to post
Share on other sites

THanks for the tip. But the problem remains. The file path doesn't evaluate correctly. The SL'ICE variable should in this case be an integer between 1 and 4. Why don't the evaluation brackets work in this case. I guess that's for the same reason why it didn't work before.

ScreenShot003.jpg

ScreenShot004.jpg

Share this post


Link to post
Share on other sites

Somehow the `  ` doesn't evaluate correctly. Is this the wrong syntax?

Edited by Pancho

Share this post


Link to post
Share on other sites

I think you maybe shouldn't put the $SLICE inside the ``, as it is a local var and will evaluate to a string already I think.

It does when you start your file path with $HIP for instance

Share this post


Link to post
Share on other sites

Mmmh. But then the math wouldn't evaluate at all?

I though tried to work with your idea that this might be a string and therefore the calculation doesn't work.

So I tried something I found in another thread, but it doesn't work either.

Very annoying.....

Strange that the first ` ` evaluates to nothing, while the second just prints what's inside the ` `.

ScreenShot004.jpg

ScreenShot005.jpg

Edited by Pancho

Share this post


Link to post
Share on other sites

A drawback of the $SLICE variable is that it wont show you the evaluated string in the file path at the top level. If you dive inside the asset you'll see that there is a foreach loop with another file node inside. It's this file node that's loading your files and if you take a look there you can see the python code that runs your script. The string isn't expanded until this python code is run.

The variable will work just fine within backticks so that's not an issue.

Your original expression should be evaluating to something. Is there maybe some frame padding on your file numbers that the expression isn't accounting for?filemerge.PNG

 

Edited by Gavin

Share this post


Link to post
Share on other sites

Try taking variables out of this entirely and see if you can get it to output something for you. If that doesn't evaluate then there's a different problem at play here.

novariables.PNG

Share this post


Link to post
Share on other sites

I believe in the File Merge node, you should change your Merge Variable to be WEDGENUM to keep the naming consistent, then you can merge based on your WEDGENUM in your filepath. The File Merge is going to try to replace every instance of your Merge Variable with the values in the Merge Range (start to end by increment). So your starting value should be your lowest seed value and the end value should be your highest seed value (not 1 and 1 as yours are now :P ). Then just make sure to set Missing Files to No Geometry so it doesnt error out for inevitable missing files in the range from start value to end value.

 

I just tested this with a simple scene: had a cube, sphere, and pyramid written out with a switch controlled by $CLUSTER variable (0=cube, 1=sphere, 2=pyramid). Then I used the File Merge node with Merge Variable set to CLUSTER and read them in with the same variable, setting the Merge Range to (0, 2, 1), and Missing Files to No Geometry -- that way, when I deleted the file where $CLUSTER=1, files 0 and 2 still imported just fine :) So you can see here I just have the cube and pyramid being read in without error. You'll definitely need the same for your particles

Screenshot-1.png

Edited by Shalinar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×