Hi,
Using the built in Python in UE4.20.3, I’m trying to get selected meshes (in content browser) to change the lightmap resolution for each, based on object size.
I’m a Python beginner, and having a hard time understanding the python documentation:
https://api.unrealengine.com/INT/PythonAPI/index.html
I’ve got this working code so far:
import unreal
@unreal.uclass()
class EdUtBase(unreal.GlobalEditorUtilityBase):
pass
EdUtBaseObj = EdUtBase()
Selected = EdUtBaseObj.get_selected_assets()
print(Selected)
print(Selected[0].get_bounding_box())
I can’t figure out the syntax of how to get / set the “Light map resolution” (found in static mesh editor, details tab > general settings rollout)
My guess was to use “target_light_map_resolution”, so my wild stab in the dark was:
unreal.MeshMergingSettings.target_light_map_resolution(Selected[0])
Which gives the cryptic error (at least for me!):
TypeError: ‘getset_descriptor’ object is not callable
Can anyone help me understand how this is supposed to be written?
For example:
unreal.GlobalEditorUtilityBase is an unreal class according to the docs. Is this why we need to make it into a class too? (see above code)).
unreal.MeshMergingSettings is also an unreal class, but treating it the same way as GlobalEditorUtilityBase does not work.
I think I’m missing some fundamentals!
Any pointers, hints, tips and discussions welcome!
Many thanks
Graham Macfarlane