j00ey Posted April 2, 2013 Share Posted April 2, 2013 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 Quote Link to comment Share on other sites More sharing options...
old school Posted April 2, 2013 Share Posted April 2, 2013 (edited) 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 April 2, 2013 by old school Quote Link to comment Share on other sites More sharing options...
j00ey Posted April 2, 2013 Author Share Posted April 2, 2013 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 Quote Link to comment Share on other sites More sharing options...
j00ey Posted April 2, 2013 Author Share Posted April 2, 2013 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... Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted April 2, 2013 Share Posted April 2, 2013 (edited) 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 April 2, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
j00ey Posted April 2, 2013 Author Share Posted April 2, 2013 Ah, I've never seen that menu item, looks very interesting. Thanks very much! Quote Link to comment Share on other sites More sharing options...
halfdan Posted April 2, 2013 Share Posted April 2, 2013 Put curly braces around {$F} to qualify it: The $ sign should be on the outside of the curly braces. E.g.: ${F} ${F}_Frame ${F}.ply Quote Link to comment Share on other sites More sharing options...
old school Posted April 2, 2013 Share Posted April 2, 2013 I corrected my post above... Brain cramp on my part. Quote Link to comment Share on other sites More sharing options...
j00ey Posted April 3, 2013 Author Share Posted April 3, 2013 Ah yes, that works now. Thanks everyone for the input, Much appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.