This is somewhat related to #91. In trying to bind MetasoundEngine to get access to CreateObjectArrayMetasoundLiteral the binding is generated, but the Nim generated C++ doesn't compile.
A workaround was to make a duplicate of the binding, createObjectArrayMetaSoundLiteral2 from the exported bindings and use that instead.
proc createObjectArrayMetaSoundLiteral2*(self : UMetaSoundBuilderSubsystemPtr;
value : var TArray[UObjectPtr]): FMetasoundFrontendLiteral {.
exportcpp: "$1_", ufunc.} =
type
Params = object
value: TArray[UObjectPtr]
returnValue: FMetasoundFrontendLiteral
var param = Params(value: value)
let fnName {.used.} = f "CreateObjectArrayMetaSoundLiteral"
var cls = uobject.getClass(ueCast[UObject](self))
when false:
cls = getClassByName("MetaSoundBuilderSubsystem").getSuperClass()
let fn {.used.} = uobject.getFunctionByNameWithPrefixes(cls, fnName)
self.processEvent(fn, param.addr)
value = param.value
return param.returnValue
However, when creating PCH bindings, by including "Runtime/Metasound" plugin in game.json's "enginePluginsByPath" and the appropriate header in nuegame.h and regenerating the bindings:
game.json:
{
"extraModuleNames": ["MetasoundEngine", "MetasoundFrontend", "MetasoundEditor"],
"enginePluginsByPath": ["Runtime/Metasound"]
}
nuegame.h:
#include "MetasoundBuilderSubsystem.h" // for Engine\Plugins\Runtime\Metasound\Source\MetasoundEngine\Public\MetasoundBuilderSubsystem.h
the generated binding for createObjectArrayMetasoundLiteral now works. Maybe it has something to do with how FMetasoundFrontendLiteral? See: Engine\Plugins\Runtime\Metasound\Source\MetasoundFrontend\Public\MetasoundFrontendLiteral.h
proc createObjectArrayMetaSoundLiteral*(self : UMetaSoundBuilderSubsystemPtr;
value : var TArray[UObjectPtr]): FMetasoundFrontendLiteral {.
exportcpp: "$1_", ufunc.} =
type
Params = object
value: TArray[UObjectPtr]
returnValue: FMetasoundFrontendLiteral
var param = Params(value: value)
let fnName {.used.} = f "CreateObjectArrayMetaSoundLiteral"
var cls = uobject.getClass(ueCast[UObject](self))
when false:
cls = getClassByName("MetaSoundBuilderSubsystem").getSuperClass()
let fn {.used.} = uobject.getFunctionByNameWithPrefixes(cls, fnName)
self.processEvent(fn, param.addr)
value = param.value
return param.returnValue
Note UMetasoundFrontendLiteralBlueprintAccess also defines a static function of the same name here: Engine\Plugins\Runtime\Metasound\Source\MetasoundEngine\Public\MetasoundFrontendLiteralBlueprintAccess.h see #93.
This is somewhat related to #91. In trying to bind
MetasoundEngineto get access toCreateObjectArrayMetasoundLiteralthe binding is generated, but the Nim generated C++ doesn't compile.A workaround was to make a duplicate of the binding,
createObjectArrayMetaSoundLiteral2from theexportedbindings and use that instead.However, when creating PCH bindings, by including
"Runtime/Metasound"plugin ingame.json's"enginePluginsByPath"and the appropriate header innuegame.hand regenerating the bindings:game.json:
{ "extraModuleNames": ["MetasoundEngine", "MetasoundFrontend", "MetasoundEditor"], "enginePluginsByPath": ["Runtime/Metasound"] }nuegame.h:
the generated binding for
createObjectArrayMetasoundLiteralnow works. Maybe it has something to do with howFMetasoundFrontendLiteral? See:Engine\Plugins\Runtime\Metasound\Source\MetasoundFrontend\Public\MetasoundFrontendLiteral.hNote
UMetasoundFrontendLiteralBlueprintAccessalso defines a static function of the same name here:Engine\Plugins\Runtime\Metasound\Source\MetasoundEngine\Public\MetasoundFrontendLiteralBlueprintAccess.hsee #93.