LoriGWiz
(LoriG)
February 11, 2022, 2:16am
1
I’m new to unreal and had a question about Unreal 5.
I have an Editor Utility Widget and I’m trying to create an interface with it and populate it with data in a python script. I’m using a Scroll Box (after struggling quite a bit with a ListView widget) and want to dynamically add text to the Scroll Box.
I found a way to add a component with in older version of unreal, but can’t figure out how to do this in Unreal 5. Anyone have an ideas?
OLD WAY :
add directional light component
directLightComponent = ue.add_component_to_blueprint(bp,DirectionalLightComponent, “Directional_light”)
import unreal_engine as ue
from unreal_engine.classes import BlueprintFactory, DirectionalLightComponent, K2Node_Event
import time
# create new blueprint from factory
bpFactory = BlueprintFactory()
bp = bpFactory.factory_create_new('/Game/test' + str(int(time.time())))
# add intensity variable
intensity = ue.blueprint_add_member_variable(bp, 'intensity', 'float')
# set its visibility to True
ue.blueprint_set_variable_visibility(bp, 'intensity', True)
# add directional light component
directLightComponent = ue.add_component_to_blueprint(bp,DirectionalLightComponent, "Directional_light")
# add node variables (get) to the graph
intensity_node = bp.UberGraphPages[0].graph_add_node_variable_get('intensity', None, 200, 100)
directional_light_node = bp.UberGraphPages[0].graph_add_node_variable_get('Directional_light', None, 200, 0)
This file has been truncated. show original
NEW WAY: ??
unreal.BlueprintInterfaceFactory(outer=None , name=‘None’ ) ??
unreal.BlueprintEditorLibrary
In my case I want to add text.
interface_factory = unreal.BlueprintInterfaceFactory(asset_loader, unreal.Text)
Unreal version 5.0.0-16682836
UE5 (5-0)