Hi, I’m trying to automate the import process for various textures.
I assumed that the path to do this would be to create a TextureFactory for each compression settings like so:
texFactory_orm.set_editor_property('compression_settings', unreal.TextureCompressionSettings.TC_MASKS)
and then assign that factory conditionally to the AssetImportTask:
def build_texture_import_task(filename, destination_path, destination_name='', replace_existing=False):
task = unreal.AssetImportTask()
texname = os.path.splitext(os.path.basename(filename))[0]
if texname.endswith('_N'):
task.set_editor_property('factory', texFactory_normal)
elif texname.endswith('_ORM'):
task.set_editor_property('factory', texFactory_orm)
elif texname.endswith('_H'):
task.set_editor_property('factory', texFactory_height)
else:
task.set_editor_property('factory', texFactory_standard)
task.set_editor_property('automated', True)
task.set_editor_property('filename', filename)
task.set_editor_property('destination_path', destination_path)
task.set_editor_property('destination_name', destination_name)
task.set_editor_property('replace_existing', replace_existing)
task.set_editor_property('save', True)
return task
but… this doesn’t work.
What am I doing wrong? There’s very little documentation I can find about texture import settings. There doesn’t seem to be a “FbxImportUI” equivalent.
Thanks in advance!