Modify Structure Values for Map Variable from Blueprint in Python

Hello guys,
I’m trying to modify a value, part of a map(dictionary in python) composed of int:myStructure.
I’m already able to modify any direct variable in the blueprint, but troubles arise from Structure, even worse that is part of a map.
I read the documentation, but It’s not clear to me.
So I’m looking for help here,
thank you all!

Hi!

Here is how you configure a unreal.Map variable, I’m using the console_variables in unreal.MoviePipelineConsoleVariableSetting as an example:

The console_variables property requires Type: (Map(str, float)) as input.

#Get movie queue subsystem for editor.
subsystem = unreal.get_editor_subsystem(unreal.MoviePipelineQueueSubsystem)
pipelineQueue = subsystem.get_queue()

#Create new movie pipeline job
newJob = pipelineQueue.allocate_new_job(unreal.MoviePipelineExecutorJob)
newJob.get_configuration().find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)

#Get ConsoleVariableSetting
ConsoleVariableSetting = newJob.get_configuration().find_or_add_setting_by_class(unreal.MoviePipelineConsoleVariableSetting)
#Set
ConsoleVariableSetting.console_variables = [("r.ScreenPercentage", 100.0), ("r.MotionBlurQuality", 4.0)]

#Append/update values
ConsoleVariableSetting.console_variables.update([("r.ScreenPercentage", 50.0),("r.MotionBlur.Scale", 1.0)])
#Print
unreal.log( ConsoleVariableSetting.console_variables )
LogPython: {"r.ScreenPercentage": 50.000000, "r.MotionBlurQuality": 4.000000, "r.MotionBlur.Scale": 1.000000}

I know its a bit late but also couldn’t find any specific examples on it so here it is.

Thank you for the answer @Havard_stardust but it’s not what I was looking for.
Maybe I poorly explained myself.

That works for console variables but I was looking how to modify the value of a Editor Property that was a map of structures.
I figured it out in the end.

obj = unreal.EditorLevelLibrary.get_selected_level_actors()[0]
print(obj.get_editor_property("test"))
asd = {"qwe": False}
obj.set_editor_property("test", asd)

Thank you again.

1 Like