Expose Omniverse UE5 Connector Function "LoadFacialAnimation" to UE5 Blueprints

Hello,

I am currently trying to expose some of the Omniverse Unreal Engine Connector functions to Blueprints, but I cannot manage to do it.
Since I saw that other functions are already exposed to blueprints, why can’t I expose those using the same structure, namely converting the class to a UCLASS and define the functions as UFUNCTION(BlueprintCallable) ?

I am available if you need any precisions about the integration context.

Hope you’ll be able to help and have a nice day !!

Which class did you try to convert to UCLASS?

I tried to convert the FOmniverseFacialAnimation to UCLASS, changing the F to an U whenever the class is called

Try this:

UCLASS()
class OMNIVERSEUSD_API UOmniverseFacialAnimation : public UBlueprintFunctionLibrary
{
GENERATED_BODY()

public:
UFUNCTION(BlueprintCallable, Category=“Omniverse Facial”)
static bool LoadFacialAnimation(const FString& Path, const FString& Dest, class USkeleton* Skeleton);

static void FindUsdSkelAnimation(const pxr::UsdPrim& Prim, TArraypxr::UsdPrim& AnimationPrims);

static bool CreateFacialAnimationSequence(const pxr::UsdSkelAnimation& SkelAnimation, const FString& ParentPath, class USkeleton* Skeleton, int32& OverwriteStatus);
};

There’re other places you should replace FOmniverseFacialAnimation with UOmniverseFacialAnimation
Also, you should delete the binaries and intermediate folders, regenerate the project files to compile

I’ll try this and I keep you updated,

Thanks very much !

So I did everything just like you indicated, and the project compiles nicely, however, I can’t manage to find the function while in the Blueprint Editor, which is a bit weird and indicates that the function hasn’t been detected by UE5.
Is there any way I could solve this problem ?

Maybe you can try this in the UE editor:
File->New C++ Class->Blueprint Function Library->a new UOmniverseFacialAnimation class. Then copying the detail from old FOmniverseFacialAnimation

Okay I’ll try it

After a bit of thinking, that’s something I tried already, and a problem I faced is that when it compiles, it doesn’t recognize the access paths to other modules such as OmniversePxr.h, nor to all the modules called recursively.
This means I need to add by hand all paths to the VS Include variable, directing to all modules and sub-modules called, which represents approx. 200 paths to copy and paste by hand.
Is there any other solution ?

You can move the 2 functions FindUsdSkelAnimation and CreateFacialAnimationSequence to another new class in a cpp, e.g. FOmniverseFacialAnimationHelper.
Then you can get rid of OmniversePxr.h in OmniverseFacialAnimation.h.

I’ll file a bug/feature request internally. It’s a good suggestion we should open some utility functions to blueprint, we’ll make it happen in the future release.

Thank you very much, I also thought it was a shame that such functions could not be called in Blueprints.
I thank you for your time and wish you a nice evening (or morning or whatever time it is where you’re from) :)

Hello, another small question : do you have any idea about when the release will come out ?
The small thing you told me to do didn’t work either, the function still doesn’t show up in my blueprint editor…

Hi Charles
You might create the wrong blueprint type, Omniverse connect is an editor plugin, so you had to create an editor blueprint, such as right clicking menu → Editor Utilities | Editor Utility Blueprint.
We’ll expose the functions to load usd (including facial animation) in the next release.