General Setupīefore we get started with any code for an actual node there is a little bit of required setup work related to how UE4 handles it's build configurations. Just be aware that some of this tutorial may range anywhere from inaccurate to wrong when dealing with any graph type other than Blueprints. Many of the overrides and functions I'll discuss are provided by lower level classes than the UK2Node we'll be primarily concerned about. This tutorial will primarily be concerned with the specific corner of the system related to Blueprints, however much of the information presented is applicable in the wider node graph situations. It's also worth mentioning that the custom nodes for Blueprints are part of a much larger system UE4 has available for generalized node graphs. They're great places to explore from on your own though! If I haven't had personal need for some extended functionality I won't have spent much time trying to figure it out. There will also be places where I can't provide much additional guidance beyond pointing out some thing's existence. They're what I've found work for me and that's it. Don't take any of my suggestions as gospel though. I identify these observations/suggestions by starting with Personally. It's based on my experiences building nodes both for my personal project as well as in a professional team environment. Most of this tutorial will focus on the code required to make a working node, but I include some personal observations and suggestions that I hope will save you future work if you plan to write more than one custom node (which I highly recommend). So I decided to finally write down everything I've learned up to this point. It was either paywalled or focused on how to manipulate the UFUNCTION meta specifiers to make a Blueprint node. I have yet to find a comprehensive writeup of this information. "Input Pin"s are those on the left side of a node and "Output Pin"s are those on the right side. "Pin" refers to all the circle and triangle elements that one or more lines can be drawn between. "Node" refers to the entire object that you place in the Blueprint graph. However, we can solve both with a custom Blueprint node. Similarly it's not possible to create a Blueprint function/macro that correctly assigns the map key and value types to the outputs (everything I tried always ended up with the key type assigned to both the key and value output). With UFUNCTION markup there's no way (at least that I ever found) for a C++ function to trigger an output multiple times as one would expect. Epic's code generation support and the "meta" tags (specified within macros like UFUNCTION) make it easy to interface C++ and Blueprints. They've also made it easy to write functions in C++ that are callable from Blueprints. Epic has very intentionally positioned Blueprints as an important component of the content authoring and runtime execution. To suggest that Blueprints are a fundamental authoring tool in UE4 probably isn't exactly revolutionary. The code snippets and examples provided in this tutorial should be enough to create your own custom Blueprint nodes, but having the engine source (especially when using an IDE with good search features) can be helpful as the nodes you build increase in complexity. Lastly having the engine source available when making custom nodes can be very helpful but not required. A purely C++ project won't require custom blueprint nodes and a purely Blueprint project won't be able to extend or use the required classes. I also assume that you're doing some combination of C++ and Blueprint development in your project. I assume a certain level of familiarity with C++ development within UE4 and an understanding of the UPROPERTY and UFUNCTION macros. If you're still working with an earlier version, some things may not be quite the same. I can also only speak to its truth for 4.16 and beyond. From the title, it's clear that this is directed at Unreal Engine 4 developers. I'd like to make a quick note about the target audience for this article before getting started. It may feel a little weird at first, but it'll become easier as you do more with it (as with most things). The engineer that introduced this to me likened it to a quasi-Assembly language. The only difference is instead of placing them on a visual graph and connecting pins visually, it's all done in code. The custom node is meant to act as a kind of wrapper around another collection of blueprint nodes. Ultimately these custom nodes function almost the same way as a Blueprint function or macro. This tutorial provides the groundwork that should allow C++ UE4 developers to construct new Blueprint nodes that can be much more powerful and user friendly than a simple C++ function that has been tagged BlueprintCallable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |