Prefab Tool - Prefab Support for Unreal Engine


Sorry for that ensure issue you ran into, I’ll include a fix in next update, meanwhile you can open “PrefabTool\Source\PrefabAsset\Private\PrefabToolHelpers.cpp” and comment out line **5504. **( The “Update Blueprint” button in prefab detail panel could be used to re-generate the blueprint after re-build the plugin ).

5504:                    ChildNode->SetParent(*ParentNodePtr);

That line is only need for attaching child component/node to inherited/native component and will trigger the ensure (added after 4.16) check if the rule been violated.

Thanks a lot for reporting that issue!

Hey there :slight_smile:

Just wanted to step in to say that the Blueprint feature is awesome!

We also improved it to support Child Blueprints and keep their custom values from Prefab to Blueprint.

Our level design process is actually going faster than ever!

Great work.

I looked at the plug-in more in-depth and came up with a couple more notes:

There’s nothing to prevent one from creating circular nested prefabs but hitting apply on such prefab will cause descent into madness and eventual out of memory crash.
With nested prefabs option turned off, there’s nothing to stop you from creating a prefab out of a prefab with poor results - nested prefabs with empty contents.
Creating a new prefab (Prefab_B) out of a prefab in the scene (Prefab_A) and immediately placing it will cause the contents of the original prefab (Prefab_A) in the scene to disappear.
“Replace Selected Actors With” action from right-click context menu on a placed prefab will replace the prefab actor but leave its contents attached to whatever you replace it with.
Occasionally “Replace Selected Actors With” will cause a crash at UObject::Rename() Line 198 - “Renaming an object on top of an existing object is not allowed” but I haven’t found a consistent reproducible case.

A nice positive - comparing InitViews/Draw performance with 4k prefabs w/ cube static mesh actor vs 4k blueprint w/ cube static mesh component the prefabs performed almost 2x better (2.5ms vs 4ms in my environment).

A couple wishes from our team:
A setting so that when we select a member of a prefab it automatically selects the parent - similar to how groups work.
A setting for the default state of “connected” so that we could have placed prefabs disconnected by default when placed.

I hope any of this feedback is useful to you, let me know if you’d like me to provide example gifs/scenes etc. And thank you, this tool has been a tremendous improvement to our workflow.


Thanks a lot for reporting the nested prefab issues! They’ll be fixed in next update.

The built-in “Replace Selected Actors with” action is problematic with Prefab, as it assumes one actor been spawned per selected actor and the new actor will be renamed to old actor’s name. I’ll add Prefab friendly "“Replace Selected Actors with"Prefab” action in next update.

Here’s a sneak peak of new context menu I’m working on:

Stamp Prefab: to place a disconnected prefab
Replace Selected Actors with Prefab: as replacement of built-in “Replace Selected Actors with” action
Change Prefab to: a shortcut to switch prefab

I plan to start working on the “group/lock selection” feature after next 1.0.6 update.

That’s so cool! I assume it’s been used in Sacred Swords? Now I wish you updating the Sacred Swords dev log on your youtube channel. :slight_smile:

Nope! It’s being used in our top-secret incoming game! I’m working in an indie studio in Lyon, France :slight_smile:

Sacred Swords was a solo-project I made aside from work to learn everything I could.

Let me know if you’d like me to take some production footage using your tool.

I see. It’ll be so cool to see how you guys using the tool in production. But…isn’t it still top-secret? :wink:

What’s new in Prefab Tool 1.0.6

1.0.6 update is live now on Unreal Marketplace and

* Add Stamp Prefab option to level editor context menu to spawn disconnected prefab actor
* Add Replace Selected Actors with Prefab to context menu as a replacement of built-in "Replace Selected Actors with" function
* Add Change Prefab option to context menu
* Add "Replace Actors With Created Prefab" option in Prefab editor setting
* Add Prefab Component Visualizer
* Now generated blueprint will inherit mobility setting from prefab
* Add workaround to persist painted vertex color of blueprint instances inside prefab
* Fix ensure issue in generated blueprint
* Fix bug when creating a new prefab out of a prefab and immediately placing it will cause the contents of the original prefab in the scene to disappear
* Fix bug circular nested prefab might be created when applying prefab change
* Fix bug attempting to create nested prefab when nested prefab support is off
* Change Prefab editor module's LoadingPhase to PostEngineInit
* Minor code refactoring

The “Replace Actors With Created Prefab” and “Prefab Component Visualizer” options could be turn on from Prefab Tool editor setting.

Prefab Tool 1.0.7 feature sneak peak - Selection Lock

Coming to 1.0.7, you can now lock selection of prefab actor. It works kind of like group, once locked, you can’t select any children actors.

( It’s probably the most requested feature, the original plan is to implement it through built-in group actor, but at the end decided to go with my own implementation. )

Prefab Tool 1.0.7 update is now live on Marketplace version submitted.

* Add Lock Selection feature, now spawned prefab actor will be locked/grouped by default
* Add context menu and hotkey to toggle lock selection
* Enable Prefab Component Visualizer by default; Now draw darker wireframe box to indicated lock status
* Add Select children actors to context menu
* Stamp prefab will now disconnecting all chidren prefab actor
* Add Undo support for hide/lock prefab actor through context menu
* Add 4.18 support; Drop 4.15 support

Do Prefabs work with custom C++ components built off an Unreal engine built from source?
I have actors with custom components (C++ blueprints) built using a custom Unreal engine 4.17. The components access parts of NVidia PhysX that are not available through the general build. If I build prefabs from standard actors and these custom components, do you foresee any problems? I want to use the prefabs in a way similar to the way we’ve used them in Unity.

regarding - 1.0.6 Update
Holy cow!!! :eek: Everyone on our team is totally blown away by the extraordinary attention from you to our requests and bugs. We greatly appreciate your work!

@jkraptor Sorry that I somehow missed your post. For prefab with custom c++ components it should works just fine as long as properties of your c++ components could be serialized (with UE4’s default serializer). E.g. if you can copy and paste the actor with the custom c++ component, you should be able to save the actor inside the prefab as well.

@Denis.Korkh, so glad to hear that :slight_smile: Hope seeing your works!

We modified the uplugin file to remove the WhitelistPlatforms for the runtime module. I’m not sure if you had a reason for doing that or not, but with that setup it does not work on a console build.

Oh, the only reason that WhitelistPlatforms line was added to the uplugin file is that it’s a requirement when submitting code plugin to Unreal Marketplace. I think Epic is using that info to build necessary binaries when staging the plugin for marketplace download.

Hi, I’m setting up discord server for all my tools:

Please feel free to post discussion / feature request / bug report in either place.

( I’m travelling from 14.Nov 2017 to 1 Dec.2017, and will be more active on discord when I’m back.)


First of all, thank you for creating this tool and for me it’s been of great help so far.

Well, I say so far because I’ve just discovered a potential issue. I need to deliver my project to the client soon and I’ve just figured out that when I package the game as an executable, all prefabs stored in content and loaded from there by my blueprints (I spawn prefabs in runtime) don’t show up in the executable. The issue is that the prefab has 0 children in it and hence can’t spawn them. Am I doing something wrong here?

This blueprint is placed in the scene and has array reference to prefabs which are then spawned using spawn actor and assigning a prefab to it. It works in editor no problems, but not in executable. Also, when packaging the project, I packaged the map with directory which stores prefabs.

Is there an obvious solution that I’m missing here?

/begin sandwich/

Still love your tool!

Noticed another issue;

  1. Drag a static mesh asset into scene (turns into static mesh actor)
  2. Right-click in content browser, create prefab (from the new static mesh actor which is selected)
  3. Save prefab, place in level.
  4. Rename the static mesh asset.
  5. Place prefab in level again - it’s static mesh actor child will not have a static mesh assigned.
  6. Reverting the previously placed prefab also unsets the mesh from its static mesh actor.

Your tool is the best.

/end sandwich/

But really, great work! Our team uses it a ton and loves it.

@Denis.Korkh I can’t reproduce the issue your encountered in 4.18. May I ask what engine version are you using? (and have you update Prefab Tool to latest version?)