I have a large list of object in UE4 that need to utilize the Bake Material function that is built in to UE4. Here are the screencaps of the Bake Material button and the options I need to implement:
However, I can not run it when I have multiple objects selected, so I need to utilize code.
For swapping materials I was able to find this script from the UE4 Channel that works well and thought I could use it as a base and modify for what I need:
Here it is in text form:
def replace_material(original, replacement):
original_asset = unreal.EditorAssetLibrary.load_asset(original)
replacement_asset = unreal.EditorAssetLibrary.load_asset(replacement)
I found this great resource showing the Python functions for UE4 but I am not exactly sure how to write what I need.
Using that and the script I found above I made an attempt though I know it is not complete, just not sure what I am missing:
I need to find a way to have this only affect the selected objects/assets so: for objects in selection ?
Any help is much appreciated. I will attempt to write it as well.