No announcement yet.

Custom blueprint nodes defined in python need to be refreshed every time I reopen the editor

  • Filter
  • Time
  • Show
Clear All
new posts

    Custom blueprint nodes defined in python need to be refreshed every time I reopen the editor

    I have two python files of interest here: "dapi" and "init_unreal"

    "dapi" contains code for custom blueprint nodes (like "Launch UI" in the screenshot). "init_unreal" only contains two statements : "import unreal" and "import dapi". The init file seems to be running on editor startup like I would expect, but the editor utility widget blueprint still fails to compile. Using "Refresh all nodes" will work and then any custom nodes will work again, but that should only be a temporary workaround.

    Is there something obvious I'm missing?

    In the output log on editor startup, I'm noticing these errors being logged before the python modules are imported. Could that be the issue?

    Click image for larger version

Name:	brokenNodes.PNG
Views:	73
Size:	59.1 KB
ID:	1780320

    This is a module lifecycle issue.
    By the time "ReconstructNode" method is called by the Blueprint graph, the custom function object in python scripting module were not created yet so pins can't be reconstructed correctly when launching the editor.

    You are then forced to refresh the node, by then the "ClassDefaultObject" have been finally loaded from whatever function library class they use, so when you refresh all nodes it can capture function signatures and rebuild pins accordingly.

    That can be avoided when the function signature comes from C++, for generated functions like the ones created by python code, I will pay attention if Epic ever fix this structural problem because I face the same limitations while working on systems where I have to find function signatures but the Function Library default object wasn't loaded yet on engine startup.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |