UE4 Asset Editor Application Mode

UE4 Asset Editor Application Mode

1 Overview


  • Base Class: FApplicationMode

  • Feature: An application mode will maintain a set of editor states, including layout, tabs, toolbar and so on.

  • Usage: Call SetCurrentMode(ModeName) in editor class (subclass of FWorkflowCentricApplication) to apply current mode;


2 Class


class FTestEditorApplicationMode : public FApplicationMode
{
public:
	FTestEditorApplicationMode(TSharedPtr<class FUserDefinedEditor> InTestEditor, FName InModeName);
	virtual void RegisterTabFactories(TSharedPtr<class FTabManager> InTabManager) override;
	virtual void PreDeactivateMode() override;
	virtual void PostActivateMode() override;
};
  • ModeName: An unique mode name is required.

  • RegisterTabFactories: Register custom tab factories to editor class, each tab factory corresponding one tab. Call PushTabFactories to register all tab factory of the application mode.


void FWorkflowCentricApplication::PushTabFactories(FWorkflowAllowedTabSet& FactorySetToPush)
{
	check(TabManager.IsValid());
	for (auto FactoryIt = FactorySetToPush.CreateIterator(); FactoryIt; ++FactoryIt)
	{
		FactoryIt.Value()->RegisterTabSpawner(TabManager.ToSharedRef(), CurrentAppModePtr.Get());
	}
}

  • PreDeactivateMode: Save state while deactivating mode.

  • PostActivateMode: Restore asset editor state while activating mode.




Tags: UE4 Editor Vistied:
Share: Twitter Facebook LinkedIn