Best practices for integrating with Interactive Tools Framework and Persona toolkit

Teodor_Nikolov
Wed, 07 Dec 2022 14:16:43 +0000
C++

Hi,

I am developing a plugin from scratch for an animation-based system. I want to visualize animations using IK Rigs inside a Persona viewport in my own plugin editor window.

I am thinking deeply about the architecture choices I make right now as I want to lay a solid foundation for the plugin. I found about Interactive Tools Framework (here and here). I am wondering how to approach using it, as I failed to find information about some other classes that I have seen throughout the UE codebase (mostly built-in editors and plugins). I am wondering about the following, primarily:

UAssetEditor

UEdMode (or FEdMode)

FBaseAssetToolkit

FPersonaAssetEditorToolkit (FWorkflowCentricApplication)

FApplicationMode

FModeToolkit

Following some of the comments from the UVEditor plugin, it seems that UAssetEditor and UEdMode are recommended. This also requires the use of FBaseAssetToolkit, which is what UAssetEditor works with. Hence, My toolkit cannot be a workflow centric application with multiple FApplicationModes. This is probably not an issue right now, but in the future the plugin might need new “editor modes”, maybe similar to how Persona does it with the Animation, Skeleton, Physics Asset and Blueprint editors. The only workaround I see is that I would create and destroy UAssetEditors, each with its own FBaseAssetToolkit. However, this would not act as a central toolkit, which FWorkflowApplicationMode seems to be. Alternatively, I use UEdMode / FModeToolkits? Also, I notice that very few plugins use the UEdMode and UAssetEditor classes, maybe because they are new. As for why I mentioned the Persona toolkit, it is because I wish to reuse its viewport, as it has nice functionality for live previewing animation assets. It seems to use its own toolkit (FPersonaAssetEditorToolkit) that extends from FWorkflowCentricApplication, but all it does differently is creating/injecting its own editor mode manager into child toolkits.

Ultimately, I am not sure whether to take the approach of UAssetEditor vs FWorkflowCentricApplication (or something else). I cannot find much documentation on this besides the 2 blog posts I mentioned above, and some articles from here.

I wish to hear some opinions on what I said above. Some prodding questions:

What are the (in-house) best practices and recommendations when building such plugins, and using the above classes?

Should toolkits be mixed (e.g. Toolkit A contains pointer to Toolkit B, both used by the plugin at the same time)? This seems reasonable, as persona exposes IHasPersonaToolkit interface, supposedly to go in other toolkits.

How to handle multiple layouts (e.g. FApplicationMode) using UAssetEditor?

Should my toolkit inherit from FPersonaAssetEditorToolkit (like most Persona editors), or FBaseAssetToolkit instead with IHasPersonaToolkit and a pointer to Persona toolkit?

Overall thoughts on the matter?

I will deeply appreciate any insight that you can shed on the matter!

As additional info, I mainly referenced the following plugins/editors: UVEditor, AnimationEditor, IKRigEditor / IKRetargetEditor, and other Persona Editors.

3 posts - 2 participants