BlueprintCompilation Overview
I. Terminology
Blueprint, like the C + + language, needs to be compiled before it is used in the game. When you are in the BP Editor, click Compile button. the BP resource starts by converting the attribute and legend process to a Class object processing.
1. fkismetcompilercontext
This class is used to do the compilation work. A new instance is generated each time the compilation occurs. Save the classes that will be compiled and BP .
2. fkismetfunctioncontext
saves information for a function. such as diagram references, attributes, and generation of ufunction.
3. fnodehandlingfunctor
A helper class that handles the nodes of a class in the compiler (singleton). Includes a register PIN link generated by the function. Generates a compilation state.
4. fkismetcompiledstatement
The compiler transforms the node into a compiled state. The backend converts it to bytecode manipulation.
5. fkismetterm
The terminal of the legend, which contains a literal,const,variable Reference(variable reference) . One of each data pin connection.
Of course you can Define variables or intermediate results by nodehandlingfunctor.
Second, the compilation process
Basic processing steps such as the following:
Orange is the only step for full compilation.
About abbreviations:
Class Default Object (CDO)
Cleanup Class
class uses Ublueprintgeneratedclass The resulting object is cleared 0 and reused. Pointers do not have to deal with UE4 themselves.
Cleanandsanitizeclass function functions are erasing function properties and functions, initializing class objects.
(Because the class object pool used by UE4, the class object is not deleted, each time replacing the old object with a new one ).
Creating class Properties
The compilation iteration passes through the blueprint's newvairable Arrays and other places (build scripts, etc.) find all the uproperites required for the class . Then use the createclassvariablesfromblueprint function to create in the Uclass scope Uproperties . (Find the properites indicator first, then use the function to create the attribute ).
Create a list of functions
Compiler uses Event Graphs creates a list of functions. Each content call precompilefunction () function to wear a normal function diagram and a precompiled function.
working with Event graphs
by using createandprocessubergraph () to implement the processing process.
This function copies all the event graphs into a large chart, creating an event node for each function after determining which nodes can be expanded. Each event diagram creates a fkismetfunctioncontext.
working with function graphs
by using Processonefunctiongraph processing function to handle regular function diagrams , the function copies each chart into a temporary chart to allow for an opportunity to expand.
Each function diagram creates a fkismetfunctioncontext.
pre-compilation functions
precompilefunction () is a pre-compiled function. Procedures such as the following:
· Run lists and calculate data dependencies
· Change nodes that have no timesheet or no data dependencies.
· The registernets () function of the execution node
· Create fkismetterms for the value of the function pinch
· Creating Ufunction and associated properties
Bindings and Links
The compiler perceives all of the classes uproperties and the uproperties . Binding and linking classes. Contains attribute relationships, property sizes, function mappings, and so on.
At this time is actually a default class object that does not have a final label and metadata.
compiler function
The next step is to pass the node handle Compile () function, using the Appendstatementfornode () function. the fkismetcompiledstatment object is generated for the remaining nodes . (that is, the resulting state object).
The appendstatementfornode function can also be created to locally-Used The fkmismet object.
finished compiling class
To finish compiling the class, compiler finalizes the class flags and propagates flags and metadata from the parent class Before finally performing a few final checks to make sure everything went alright in the compile.
Before the final compilation, it is necessary to ensure that all checks are correct, the compiler confirms the class marking, and propagates the label. The metadata from the parent class.
Generate Code
backends transitions from the state of each function's content to code.
Two backends use:
· Fkismetcompilervmbackend - Conversion FKCS script byte stream for unreal virtual machine. The byte stream is serialized into the script array of the function.
· Fkismetcppbackend - generate a class for debugging C + + code.
Copy class default object properties
Use copypropertiesforunrelatedobjects () function, the compiler copies the value of the old default object to the new CDO. The property copy is serialized by the label. Only the same name can be converted correctly. In this phase the CDO component rebuilds the instance and changes appropriately. The generatedclass CDO is authoritative.
rebuilding an instance
because the size or property of the class increases or decreases, the compiler needs to rebuild the instance each time it compiles. The process uses tobjectiterator to find an instance of all classes, creating a new class. Use the copypropertiesforunrelatedobjects function to copy the old instance to the new instance.
about Details , please look fblueprintcompilereinstancer class.
===============
Original address: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/TechnicalGuide/Compiler/index.html
Beginner translator, in a very trepidation!
There are shortcomings, please guide!
Thank you very much!
Blueprint Compilation Process