of hou.Parm and
Returns a sequence of tuples representing all references to external files (such as textures, geometry files, and asset libraries) in the current scene.
The first item in each tuple is a hou.Parm object representing the parameter containing the file reference, and the second item is the path string. (The second item is a convenience; you can get the same string by calling
This can be useful when “preflighting”, to check that there are no references to files outside
import os hipdir = os.environ["HIP"] for parm, path in hou.fileReferences(): # Assume you have a function to check if one path is the descendent # of another path if not is_inside(hipdir, path): print("Problem: path %s is not inside the project dir %s" % (path, hipdir)
(The sequence does not include default images and geometry files from inside Houdini’s install location, for example
default.bgeo in a File SOP.)
You can specify the name of an environment variable. If an asset path starts with the variable, it will be replaced with a variable reference in the path string returned by this function.
For example, if
/mnt/projects/ and an asset is in
/mnt/projects/tool.hda, if you call
hou.fileReferences("JOB"), it will return the path as
If this is True, then the function will return all the file references. If this is False, then the function will return only the selected file references.