Travis Posted February 6, 2020 Share Posted February 6, 2020 Hi guys, I am trying to automate my alembic imports by using a string replace on my File path. For example: on my alembic File Name parameter I've written the expression - `strreplace($HIP, "home/fx", "fx/waterfountain_v001")`.abc I would like to be able to replace the version number with a wildcard so that it picks up the file regardless of what the version number is, but an (*)asterisk doesn't work. How should that be scripted? Thank you in advance! Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted February 12, 2020 Share Posted February 12, 2020 For the frame number use $F3, where 3 is padding Quote Link to comment Share on other sites More sharing options...
Travis Posted February 12, 2020 Author Share Posted February 12, 2020 Thank you Alex. I don't think I need frame padding, as the alembic isn't a sequence. I am just wondering how to add a wildcard for the version number? I think the Alembic node in Houdini may not recognize wild cards though. Is that the case? Do you know a work around? Quote Link to comment Share on other sites More sharing options...
anim Posted February 13, 2020 Share Posted February 13, 2020 (edited) wildcards or simple expressions don't check files on disk so they will not go find what is the actual version in there (even then what would you expect if wildcard matches more than one file? ) path built by expression has to result in a specific file path that will be loaded if found your best bet would be using python script that actually looks up the directory and finds the latest version for example but rather than using it as a live expression it may be safer to have it as a menu script in a dropdown and then just reference picked value in your path expression, so that it doesn't have to check the disk all the time, just when the menu is invoked Edited February 13, 2020 by anim Quote Link to comment Share on other sites More sharing options...
Travis Posted February 13, 2020 Author Share Posted February 13, 2020 Thanks Tomas, The wild card would only grab the correct file, because there is only ever one file in that directory. I will look into a solution using python. Thank you very much for responding! Quote Link to comment Share on other sites More sharing options...
anim Posted February 13, 2020 Share Posted February 13, 2020 (edited) 26 minutes ago, Travis said: ...The wild card would only grab the correct file, because there is only ever one file in that directory.... right, but I meant in general, if pattern matches more existing files it's a bit ambiguous, so yeah, with python you can make up the exact logic what would be looked for and picked Edited February 13, 2020 by anim 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.