On Post Bake Delegate not allowing me to bind callable to it

   1746   1   0
User Avatar
Member
5 posts
Joined: 5月 2019
Offline
Hi!

I'm working in Unreal 5.2, using UnrealPython in tandem with Houdini Engine for my pipeline work!

So far I'm able to successfully bind callables to other delegates of the HoudiniPublicAPIAssetWrapper to execute functions post-instantiation of the wrapper, post-cook and post-processing.

def bind_post_instantiation(HDAwrapper):
    HDAWrapper.on_post_instantiation_delegate.add_callable(post_instantiation)

def post_instantiation(HDAWrapper):
    print("test post instantiation")

But I'm currently stuck trying to do the same for the On_Post_Bake_Delegate! Not too sure what i'm doing wrong here, would like some help on this!


def bind_post_bake(HDAwrapper):
    HDAWrapper.on_post_bake_delegate.add_callable(post_bake)

def post_bake(HDAWrapper):
    print("test post bake")

The exception that's raised on this line is:
Exception: HoudiniPublicAPIAssetWrapper_OnHoudiniAssetPostBake: Callable has the incorrect number of arguments (expected 2, got 1)


Thank you!
Edited by tov95 - 2023年9月12日 06:36:57
User Avatar
Member
5 posts
Joined: 5月 2019
Offline
Ah ok I found the fix :/ I should learn to read better :S

Exception: HoudiniPublicAPIAssetWrapper_OnHoudiniAssetPostBake: Callable has the incorrect number of arguments (expected 2, got 1)

def bind_post_bake(HDAwrapper):
    HDAWrapper.on_post_bake_delegate.add_callable(post_bake)

def post_bake(HDAWrapper, bake_success):
    print("test post bake")

the callable should be able to accept the second argument of whether the bake is successful or not , similar to post_cook
Edited by tov95 - 2023年9月12日 06:37:43
  • Quick Links