Allows you to process a .obj file or multiple .obj files and convert them to HDA's. This can be used to facility kitbash library conversions that are often in .obj format.
This can also be used within python.
objToHDA(files=None, renderer=None, suffix=None, reference=None, geopath=None, texpath=None, scale=None, skipHDA=None, mtlOverride=None):
'''
files = Array of full path/filenames
Renderer Options:
0: Octane
1: Redshift
2: 3Delight
3: Renderman
4: VRay
5: Arnold
6: USD PreviewSurface
7: MaterialX (H19+)
8: Mantra
reference = 1 if you want the files referenced (HDA only)
suffix = a string that gets added to the end of the filename, ie. _Octane or _Redshift
geopath = path to referenced geo, where the objects can be found (HDA only)
texpath = path to referenced texures, where the textures can be found (HDA only)
scale = if you want to scale the model
skipHDA=True will disable HDA creation and only write bgeos
mtlOverride = full path to an mtl file you want to use instead of the <object>.mtl (-1 is disabled)
an Example for multiple files (will run through every .obj file in that folder:
import glob
objfiles = glob.glob("C:/Users/olive/Downloads/Oliver/OBJ/*.obj"):
shelftools.objToHDA(files=objfiles, renderer=0, suffix="_OCT", reference=1, geopath="$LIB/ArchModels165/geo/", texpath="$LIB/ArchModels165/tex/", scale=0.01, skipHDA=None, mtlOverride=-1)
'''