Jump to content

Import Automate with String replace


Travis

Recommended Posts

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by anim
Link to comment
Share on other sites

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