PublicAPI Python: set world input for existing AHouAssetActor

   548   1   0
User Avatar
Member
6 posts
Joined: Feb. 2022
Offline
Hey folks!

I've been trying to setup a script that takes an existing AHouAssetActor in the scene and sets its world input using Python.


    api = unreal.HoudiniPublicAPIAssetWrapper
    global _g_wrapper

    levelObject = unreal.EditorActorSubsystem()
    HDA_actor_array = levelObject.get_selected_level_actors()
    HDA_actor = HDA_actor_array[0]

    _g_wrapper = api.create_wrapper(None,HDA_actor)

    _g_wrapper.on_post_processing_delegate.add_callable(configure_inputs)

def configure_inputs(in_wrapper):
 world_input = in_wrapper.create_empty_input(unreal.HoudiniPublicAPIWorldInput)
 world_input.set_input_objects(actors)
 in_wrapper.set_input_at_index(0, world_input)

This is where I get an error:
HoudiniEngine:PublicAPI] SetInputAtIndex: Could not find a HoudiniInput for InNodeInputIndex 0. Has the HDA been instantiated?

Am I missing something? Do I have to re-instantiate the HDA somehow? there's no example for this use case and I'm finding a hard time going through the API and figuring it out.
Any tips would be appreciated.
Edited by Skawt - Nov. 15, 2023 10:00:06
User Avatar
Member
6 posts
Joined: Feb. 2022
Offline
Figured it out for those wondering:


when using an existing HoudiniAssetActor you should use instead of set_input_at_index:

in_wrapper.set_input_parameter('inputName', world_input)
  • Quick Links