Hi!
Is it possible in a Houdini to make sure that predefined variables in the environment are automatically replaced when they see a specific template in the path to some file on the disk?
For example, there is an external environment variable TEST=/home/lib, I start writing or indicating the path to the geometry in the file node /home/lib/geo/pig.bgeo.sc and knowing well that there is such a variable that will automatically change this part to variable $TEST/geo/pig.bgeo.sc
This situation may look artificial, but in fact people very often use absolute paths to files on disk, forgetting that some people can work in another operating system where the direction of slashes and where the source file lies plays a role.
If you give any clue how this can be done technically, I will be glad to help.
AutoCorrect File Path
2367 5 1- alexwheezy
- Member
- 293 posts
- Joined: Jan. 2013
- Offline
- krueger
- Member
- 191 posts
- Joined: Oct. 2018
- Offline
Someone may know a better way, but the thing I can think of is a script that's run during an event. It could be on file save or load and iterate over all the node types you want, or on something like on node loaded which would happen on file load or copy/paste.
Something like this could be used for file nodes on loaded:
Some more info on node python events:
http://www.sidefx.com/docs/houdini/hom/locations.html#event-types [www.sidefx.com]
Something like this could be used for file nodes on loaded:
node = kwargs["node"] job = hou.getenv("JOB") file = node.evalParm("file") if job.lower() in file.lower() : newFile = file.replace(job, "$JOB") node.parm("file").set(newFile)
Some more info on node python events:
http://www.sidefx.com/docs/houdini/hom/locations.html#event-types [www.sidefx.com]
- alexwheezy
- Member
- 293 posts
- Joined: Jan. 2013
- Offline
- ivantitov_zd
- Member
- 27 posts
- Joined: Feb. 2017
- Offline
- pezetko
- Member
- 392 posts
- Joined: Nov. 2008
- Offline
- alexwheezy
- Member
- 293 posts
- Joined: Jan. 2013
- Offline
-
- Quick Links