sortIndex | sidebar |
---|---|
1 |
ue4guide |
There's on overabundance of class/OOP and hard to track what is supposed to do what. Here's a great diagram from http://www.ms.mff.cuni.cz/~polakma1/adventure-plugin/programming.html that crystalizes the relationships.
From a functionality/responsibility viewpoint:
IMPORTANT! This is just a literal translation from the excellent github repo https://github.com/Eragon-Brisingr/XD_GraphEditor_Template
Rename all types with _Template to the required type name.
- EdGraphSchema defines most of the global behavior of chart operations
- Map UEdGraph and EdGraphSchema in FBlueprintEditorUtils :: CreateNewGraph
EdGraph is a type of chart instance that defines the behavior of the chart (such as saving a chart
- EdGraphNode is the type of graph node instance, which defines the behavior of the node
- AutowireNewNode defines the automatic connection behavior of the node
- You can call FAssetEditorToolkit :: InitAssetEditor during initialization to define the layout of the panel. (For complexity, refer to FApplicationMode)
- Define basic editor operations by registering events (copy, paste, copy, delete, etc.) with variables in FUICommandList
- FConnectionDrawingPolicy
- FEdGraphSchemaAction
Inherit S type to achieve display behavior
Node display definition
Map SNode and UNode types via UEdGraphNode :: CreateVisualWidget
Pin display definition (the blueprint is where the parameters can be connected)
Map SPin to SNode via SGraphNode :: CreatePinWidgets
- Define the categories when creating a resource GetCategories
- Defines the operation when the resource is requested to be opened. OpenAssetEditor maps the FAssetEditorToolkit to the resource (UBP_Graph_Template) used at runtime.
Factory class, editor for instantiating chart resources
Overriding GetGraphContextActions in UEdGraphSchema
Overriding GetContextMenuActions in UEdGraphNode
Overriding GetContextMenuActions in UEdGraphSchema to add actions to global Node or Pin
Set ErrorMsg, bHasCompilerMessage, ErrorType (EMessageSeverity :: Type) in UEdGraphNode
SGraphNode calls UpdateErrorInfo where the node needs to update error information
Collection of panels 2. Call FWorkflowAllowedTabSet :: RegisterFactory to register the definition of each panel instantiation 3. Call FWorkflowCentricApplication :: PushTabFactories (a base class of FBlueprintEditor) to register FWorkflowAllowedTabSet
Base class of panel instantiation definition 2. Inherit and rewrite FWorkflowTabFactory :: CreateTabBody to instantiate a specific panel 3. Register the panel instantiation definition with the FWorkflowAllowedTabSet instance (FWorkflowAllowedTabSet :: RegisterFactory)
GatherClasses collects UClass information
FGraphEditor_ClassHelper_Template (UClass * InRootClass); InRootClass in the constructor
Created chart control
Resource type of custom blueprint 2. Call FKismetEditorUtilities :: CreateBlueprint to create a blueprint resource 3. Override GetReparentingRules to define the parent classes that this blueprint type can use
- Runtime type of custom blueprint
- Define the mode of the App
- Define the initial interface layout
- ** FBlueprintEditor :: RegisterApplicationModes ** rewritten to map operations
- Call FWorkflowCentricApplication :: PushTabFactories (a base class of FBlueprintEditor) to set FWorkflowAllowedTabSet (the definition of all panels)
- FApplicationMode :: ToolbarExtender is the current toolbar. Add functions to the toolbar through FBlueprintEditor :: GetToolbarBuilder ()-> AddCompileToolbar (ToolbarExtender). You can also call FExtender :: AddToolBarExtension to add custom functions.
- Blueprint compilation process definition
- Register the compiler during module initialization, FKismetCompilerContext :: RegisterCompilerForBP
- Rewrite FinishCompilingClass to copy charts and add binding events after blueprint compilation.
- Override CreateClassVariablesFromBlueprint to expose variables used in designing diagrams. The advantage over FBlueprintEditorUtils :: AddMemberVariable is that variables cannot be edited in the blueprint.
S type of chart editor
SNew (SGraphEditor) .AdditionalCommands (Commands) .GraphToEdit (EdGraph);
- IDetailPropertyExtensionHandler Extension of each property
- IDetailCustomization expands the entire Detail panel
- FKismetEditorUtilities :: FindBoundEventForComponent
- FKismetEditorUtilities :: CreateNewBoundEventForClass
- Blueprint binding event base class, subclass UComponentDelegateBinding is the object binding
- Runtime binding events are stored in UBlueprintGeneratedClass :: DynamicBindingObjects
- UDynamicBlueprintBinding :: BindDynamicDelegates performs runtime binding
- Refer to FDelegateEditorBinding and FDelegateRuntimeBinding in UMG module
- Define EditorBinding in your own blueprint class and RuntimeBinding in GeneratedClass
- Write the binding operation at runtime by reflection