Import Xgen Groom with conversion settings not working (Python)

Hiya @anonymous_user_87e5ba83

My GUI import settings are:

while my code conversion settings are:

conversionSettings = unreal.GroomConversionSettings(rotation=[90.0, 0.0, 0.0],
scale=[1.0, -1.0, 1.0])

And the grooms do come in correctly. So yes, the code is being applied correctly.

The only difference that I see with your code versus mine is that I call

AssetImportTask.set_editor_property(‘options’, groomData)

after the AssetImportTask object is created. Logically, that shouldn’t make any difference but who knows what voodoo is going on under the hood in the C/C++ layer.

Here is my full import function, if you want to copy and paste that to try:

def doImport(sourcePath, destPath, replaceExisting) :
AssetTools = unreal.AssetToolsHelpers.get_asset_tools()
import_tasks = []

for fname in os.listdir(sourcePath):
    if fname.endswith('.abc'):
        AssetImportTask = unreal.AssetImportTask()
        AssetImportTask.set_editor_property('automated', True)
        AssetImportTask.set_editor_property('filename', sourcePath + '/' + fname)
        AssetImportTask.set_editor_property('destination_path', destPath)
        AssetImportTask.set_editor_property('replace_existing', replaceExisting)
        AssetImportTask.set_editor_property('save', True)


        conversionSettings = unreal.GroomConversionSettings(rotation=[90.0, 0.0, 0.0],
                                                            scale=[1.0, -1.0, 1.0])  # maya to unreal diffs
        options = unreal.GroomImportOptions()
        options.set_editor_property('conversion_settings', conversionSettings)

        groomData = unreal.GroomAssetImportData(options)  # this part is critical, you have to pass in the options into the GroomAssetImportData object

        AssetImportTask.set_editor_property('options', groomData)

        import_tasks.append(AssetImportTask)

AssetTools.import_asset_tasks(import_tasks)

I have a loop in there because our characters have multiple grooms.

Cheers!