首页 > 其他分享 >UE编辑器扩展

UE编辑器扩展

时间:2022-11-19 22:47:44浏览次数:44  
标签:菜单 工具栏 自定义 扩展 编辑器 注册 FPropertyEditorModule UE FExtender

EditorPlugin

新建plugin 包含多个modules默认包含 Type为 Runtime 和 Editor

module模块定义文件定义了依赖的模块

WidgetReflector 显示Slate的构造

 

自定义属性

注册 detail customizations

  • 在 StartupModule()方法中注册 
  • 首先找到FPropertyEditorModule FModuleManager::LoadModuleChecked<FPropertyEditorModule >("PropertyEditor")
  • 注册FPropertyEditorModule::RegisterCustomLayout("BaseEditorTool",FGetDetailCustomizationInstance::CreateSP(&FBaseEditorTool::MakeInstace))
  • 通知FPropertyEditorModule模块改变 FPropertyEditorModule::NotifyCusomizationModuleChanged()
自定义属性方法
  • 继承IDetailCustomization
  • 在方法CustomizeDetails方法中自定义属性面板布局
显示属性窗口
  •    TSharedRef<SWindow> Window = PropertyModule.CreateFloatingDetailsView(ObjectsToView);
  自定义菜单工具栏 注册菜单或菜单
  • 找到注册地方 FLevelEditorModule FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor")
  • 创建FExtender  FExtender 添加Menu commands 或者  tool commands. 包含了添加的位置和添加菜单或工具栏的方法,添加的命令。具体方法为:FExtender:: AddMenuExtension/ FExtender::AddToolbarExtension
  • 将含有菜单 工具栏的FExtender注册到相应的管理器中 
  • 菜单: levelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender)
  • 工具栏:levelEditorModule.GetToolBarExtensibilityManager()->AddExtender(ToolbarExtender)
  • 找到创建extension的位置:EditorPerferences/General/Miscellaneous/DisplayUIExtensionPoints 显示编辑器所有extension的位置
  • 在AddMenuExtension中提供的静态函数中通过 MenuBuilder::AddMenuEntry  FUIAction 添加菜单项
  扩展GraphNode
  •  FNodeHandleFunctor  UK2Node_VariableSet::CreateNodeHandler
  •  自定义pin 类型
  增加新的Asset类型
  • 数量类型继承自UDataAsset
  • AssetFactory 导入新建资源 创建默认的Actor方法
  • FAssetTypeActions_Base 自定义资源图标处响应的Actions
  • ThumbRenderer 图标出资源显示自定义Preview绘制
  • CustomEditor 自定义ViewportClient  属性面板 Layout ,参考 FStaticMeshEditor
EditorMode
  • 接管输入,影响level editor 一些显示
  ComandList
  • 继承自TCommands<T>   RegisterCommands 注册命令,  UI_COMAND宏注册一个Command  名称 , ActionType, InputGesture 
  • Editor Preferences/General/KeyboardActions 绑定Command的输入
  • 映射Action绑定命令的响应,  MapAction(命令, 执行函数,有效状态判定函数)
  FStyleSet
  • 绑定资源集合 笔刷贴图 字体

标签:菜单,工具栏,自定义,扩展,编辑器,注册,FPropertyEditorModule,UE,FExtender
From: https://www.cnblogs.com/running-radish/p/16907395.html

相关文章