If the process failed, we run a canned message which is hard coded and simply needs to return a notification to the user. We know this script will return a bool, so we run this through a Branch node. When this is called, we simply call our Create Prefab Python node. We have our custom function Make Prefab under the Actor Actions category. The entire Bluetility Blueprint using our custom Create Prefab Python node. For expandability and ease of reuse, I developed these in their own module called Ue_Factories. The first thing we will find when creating our assets is we need two specific Unreal Factories to generate the types of assets we are trying to build, a Blueprint factory and a World factory. None the less, the following Python code should still work, though the way I am integrating it into my Blueprint may need rework. Note: According to the update on the same post that I mention above, this appears to not be the preferred way to integrate Python into blueprints anymore, so I will have to look into updates at a future time. Since this post does a much better job explaining it, I suggest reading this if you are unfamiliar with that process. Building The Custom Python NodeĪs a preface, earlier in development we had integrated Python into our Unreal workflow, and started the development of our own Blueprint nodes in Python using the and wrappers discussed in this post. This requires artists to take the additional step after creating a level instance, of creating an appropriately named and placed Blueprint of the LevelInstance Class, then manually assign their new level instance to this Blueprint before continuing. Level instances however, do support other asset types, and offer much of the same functionality as Packed Level Instances, with the exception that they do not automatically create a Blueprint which can then be used to place additional instances of your prefab. It is strictly reserved for the instancing of static meshes. Secondly, this workflow simply does not support non-static-mesh assets and as far as I am aware Epic has no intent to include other assets into this workflow. This causes problems for artists who are less technically minded, and inevitably leads to naming and directory issues when assets are saved inappropriately, which means someone must be policing their use constantly to avoid a pile up of mistakes, and eventually worse – a pile-up of redirectors. The only real drawback I have found is that the workflow requires a strong understanding of what is being created and why it is being created. The Packed Level Instance workflow for static meshes is an incredible advancement paired with Nanite technology. As such, the majority of the focus will be on the Python API. The vast majority of this tool was written in Python using Unreal’s API, only using Blueprint scripting to generate the right-click functionality, and to run a feedback message if something goes wrong or the process is cancelled. This is all done in real time, and can be done from any instance, or within the prefab’s generated level. We then demonstrate the default Level Instance/Packed Level Instance editing functionality working with our prefab, and can see the duplicate prefab updating. In the clip above, we see two instances of our prefab placed in the world. If you can place it in a level, it should work properly. I tried to use a number of various object classes in this demonstration, but I have yet to find an object class that doesn’t work with this system. The following demo videos demonstrate using this workflow to build out everyone’s favorite crafting location – a campfire. This results in a more modern feel to building out “prefabs” that is as simple as selecting your assets and using the right-click context menu. I landed on a happy marriage between Packed Level Instance Blueprints, Level Instances, and the default in-level editing features in UE5. In an effort to implement a pseudo-prefab system in UE5, I spent countless hours digging through docs, attempting to build them manually through various combinations of features. This means a major feature of traditional prefabs – the ability to package multiple asset types together – remains missing. To make matters worse, the system only supports static meshes. When I first got my hands on the early access version of UE5 I found building out MegaAssemblies to be a tedious, confusing process, even after doing it a few times. I know myself and many others were ecstatic when Epic first teased the Packed Level Instance Blueprints (aka MegaAssemblies) system for Unreal 5. Unreal Engine 5 doesn’t have a true prefab system. If you want to place a campfire, you can combine a firepit, VFX, lights, and sound effects into one asset to be placed and updated together. Prefabs are an incredibly common, extremely powerful tool in any world-builder's kit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |