Hi guys,
I need to add a new button to the Animation Editor and from the function binded to that button I want to get access to the currently opened AnimationAsset. The problem that I’m facing is that I don’t know how get a reference to that AnimationAsset.
I’m addding the button to the AnimationEditor’s Toolbar from the StartupModule function in my plugin. Something like this:
IAnimationEditorModule& AnimationEditorModule = FModuleManager::LoadModuleChecked<IAnimationEditorModule>("AnimationEditor");
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension("Asset", EExtensionHook::After, PluginCommands, FToolBarExtensionDelegate::CreateRaw(this, &FDemoPluginModule::AddToolbarExtension));
AnimationEditorModule.GetToolBarExtensibilityManager()->AddExtender(ToolbarExtender);
That works perfectly.
Now, looking inside the source, the AnimationEditor is loaded from AnimationEditorModule::CreateAnimationEditor using InitAnimationEditor passing as parameter the AnimationAsset that we want to open and AnimationEditorModule.CreateAnimatioEditor is called from a AssetTypeActions_AnimationAsset when you open any AnimationAsset. The currently opened AninationAsset is stored in a private variable in AnimationEditor class
So, my question is. How can I get a refference to that AnimationAsset from my Plugin ?
PD: Sorry for my english :S
Thanks in advance.