I’m a rather experienced programmer, but I haven’t touched Python before, so I don’t know if the problem I have is related to the API itself or if it something about Python. I have about 6000 materials that i would like to consolidate to material instances that I already prepared.
I tried using this in my pipeline, unreal.EditorAssetLibrary.consolidate_assets()
Simplified version of the Code:
import unreal
asset=unreal.EditorAssetLibrary.load_asset('/Game/FirstPerson/AA2Assets/Textures/T_AA2_Misc/Roof/misc2_roof_shingle01_brown_Mat_Inst.misc2_roof_shingle01_brown_Mat_Inst')
material=unreal.EditorAssetLibrary.load_asset('/Game/FirstPerson/AA2Assets/Textures/T_AA2_Misc/Roof/misc2_roof_shingle01_brown_Mat.misc2_roof_shingle01_brown_Mat')
materials=[material]
result=unreal.EditorAssetLibrary.consolidate_assets(asset,materials)
i get:
LogEditorScripting: Error: ConsolidateAssets. The object ‘misc2_roof_shingle01_brown_Mat’ doesn’t have the same class as the AssetToConsolidateTo.
Is it impossible to use this to consolidate a Material to a Material Instance, or am I just using it wrong?