Answered
Image to Material API
Hi all,
I was wondering if it's possible to script an Image to Material pipeline using the Command Line Tools/Automation Toolkit or the Sampler Python API?
Thanks,
Ryan
Hi all,
I was wondering if it's possible to script an Image to Material pipeline using the Command Line Tools/Automation Toolkit or the Sampler Python API?
Thanks,
Ryan
Hello, @ryangold333 !
I had the same issue. You can write this functionin your script in pycharm and save it as the .py file. Then import to the Sampler Edit->Preferences-> Plugins and Scripts.
def image_to_material_batch(folder_path):
for file in os.listdir(folder_path):
#here you can define texture format to avoid importing unnecessary files
if file.endswith(".png"):
image_path_list = [os.path.join(folder_path, file)]
asset_name = os.path.basename(file).split('.')[0]
asset = ssa.create_asset(asset_name, ssa.material)
asset.import_images(image_path_list, 0, ssa.image_to_material_AI_powered, False)
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.