Jump to content

$F_Frame in filename string


Recommended Posts

Hello

I'm pretty new to Houdini so apologies if this is a really dumb question...

I'm trying to read in a series of 3D scans in ply format exported from another soft. They're named:

0_Frame 0.ply

1_Frame 1.ply etc...

When I put "$F_Frame $F.ply" [without the inverted commas] in the filename field of a File SOP the string appears to evaluate to " 1.ply" [ie with a space before the frame number]. If I instead put "$F Frame $F.ply" it evaluates to "1 Frame 1.ply".

Can someone tell me what I need to put in here or if I should just batch rename all the files?

Thanks very much in advance

Link to comment
Share on other sites

Put curly braces around {$F} to qualify it:

${F}_Frame ${F}.ply <<< Fixed the error where I mistakenly put {} around $F

There are some that argue for . separators between frames and names and others that use _ then some use - but spaces? Windows I guess.

As far as I am concerned, I don't care as I qualify my variables with {} so the houdini string parser can properly deal with variables then write modern wrapper scripts that can deal with _, -, or . .

Edited by old school
Link to comment
Share on other sites

Hi

Thanks very much for that.

Yes, I've no idea who thought that putting a space in would be a good idea but yes it's windows. The other software is Artec Studio which is a 3D scanning application [works with Artec hardware]

I tried the curly braces and it's evaluating the frame numbers now but it keeps in the braces so now it's evaluating as {1}_Frame {1}.ply and consequently still doesn't work.

Is there some way I can add this to a null for example as a string variable, evaluate it there then reference it with chs() maybe?

Thanks again for your time

Link to comment
Share on other sites

I've figured out a way of doing this but it doesn't seem a very elegant method. This is what I now have in my filename field:

`strcat("G:/dumbThings/Minotaur/scansExport/front and right/",strcat($F,strcat("_Frame ",strcat($F,".ply"))))`

I'll stick with this for now and write out more sensibly named geo sequences but I'd be very interested in a cleaner solution should anyone have one...

Link to comment
Share on other sites

Guest mantragora

Add your custom expresion in Edit->Aliases and Variables->Expressions:

string MyPath(string path, string filename, string extension, float frame)
{
string begin = strcat(path, frame);
string middle = strcat(filename, frame);
string merged = strcat(begin, strcat(middle, extension));
return merged;
}

and then in path

`MyPath("$HIP/Desktop/New folder/", "_Frame ", ".ply", $F - 1)`

OR

string MyFileName(string filename, string extension, float frame)
{
string begin = strcat(frame, filename);
string end = strcat(begin, frame);
string merged = strcat(end, extension);
return merged;
}

and then in path

$HIP/Desktop/New folder/`MyFileName("_Frame ", ".ply", $F - 1)`

Edited by mantragora
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...