PhiltreX
(PhiltreX)
June 4, 2020, 3:42am
8
anonymous_user_eafd2be3:
Hi there guys,
ive attempted the above, but im receiving the following messages. please can someone help!
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import unreal
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
ModuleNotFoundError: No module named ‘unreal’
>>>
>>> def replace_material(original, replacement):
… original_asset = unreal.EditorAssetLibrary.load_asset(original)
… replacement_asset = unreal.EditorAssetLibrary.load_asset(replacement)
… unreal.EditorAssetLibrary.consolidate_assets(replacement_asset, [original_asset])
…
>>> replace_material(“/Game/Content/Materials/Metals_-Steel -_RSA_S355J”, “/Game/Content/Materials/M_Metal_Steel”)
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “<stdin>”, line 2, in replace_material
NameError: name ‘unreal’ is not defined
>>>
Have you set Unreal’s built-in Python version to 3.X?
Your code looks like it is running in an environment other than Unreal Editor, so the header file cannot be found.