Download

Prefab Tool - Prefab Support for Unreal Engine

Strange. I’m using UE 4.18.2 and Prefab 1.0.7
I double checked my repro steps and still get the same result. (regarding renaming the source static mesh.)

Edit:
The only thing I can think of is that if one were to do this to a static mesh which is referenced by other assets such that it creates a redirector - I imagine the repro steps wouldn’t produce the same bug since the prefab would point to the newly created redirector. In my case, no redirector for the source mesh is created since no other assets reference it. Hope this helps.

Edit2:
I walked through it a little and have found that the PrefabContent string contains the old source mesh name after the rename.
The prefab which is already placed in level during rename is handled properly but changes to it aren’t propagated to the asset - if I hit apply on the already placed prefab after source mesh rename placing prefab of that type works after. In summary, renaming source mesh fixes references in prefab instances already placed in level but not the asset version of it in the content browser.

Edit3:
I think I found the problem and it has to do with not saving the level during any of the steps. If I save the level even just after placing the original static mesh, before creating the prefab everything works ok. I stumbled on it by looking at where it was getting the content string and it appeared to be looking through the level for the static mesh actor archetype definition which still had the old mesh name. So I suppose I stumbled into an edge case - I don’t imagine this would come up often.

@Denis.Korkh Thanks a lot for your detail repro steps! I just found out that in 4.18 there’re extra quote string for asset’s path which causing asset references tracking failed. I’m working on a fix for that.

No problem, thank you for being on top of it! I have an unrelated thought as part of making a prefab best practices for our project and figured I’d share.

In addition to using prefabs for organizing arrangements of props, our artists were asking for this sort of tech in order to be able preserve the ability to make project-wide changes to a single arrangement of props. Example: given a prefab of a tree stump w/ rocks and flowers around it we may want to tilt the stump at an angle to give it attitude.

Prefab allows exactly that but the problem on a bigger project is you never have full knowledge of the context of any given instance of this stump. Suppose somewhere in the project an apple was placed on the tree stump which would now probably either intersect or float above the tilted tree stump. So its a very tempting practice but I think its dangerous on a large project and may discourage it. An interesting feature which may help this problem would be a way to render out a snapshot of each place some prefab is used. It may be challenging to have a general solution where to place the view for rendering the instances. One way might be to allow a prefab to have a thumbnail scene node/camera which can be adjusted by the artist for this purpose. For my example (tree stump and flowers) I might arrange the camera overhead. I’m tempted to hack something like this together but it may also be an interesting feature out of the box.

Hello there :slight_smile:

I’m encountering issues regarding the “Generate Blueprint” feature!

When I create a Prefab composed of StaticMeshActors and “Generate Blueprint” out of it, it generates a Blueprint with Child Actors filled with StaticMeshActors instead of creating a Blueprint with Static Mesh components.

Another issue I have is the “Generated Blueprint” reference is lost when I remove the Prefab which originally generated it off the map. Replacing the Prefab gives me an unconnected Prefab and I have to manually reconnect the Prefab and its Blueprint.

And something I would love to see added is to be able to specify an array of actor class that I would like the “Generate Blueprint” feature not to add to the generated Blueprint. I’d like to specify this in a global way.

I was doing a series of tutorial about building a Diablo-like dungeon generator and I really counted on that feature to streamline the level design process. I made a video about using Prefab Tool and in the middle of it I realized these two bugs were kind of ruining the perfect workflow Prefab Tool can offer :frowning:

I love the work you’re doing, hope you’ll get everything solved!

Good luck and have fun everyone :slight_smile:

@Yun-Kun

“Generate Blueprint” currently will always create child actors for every actors inside the prefab. In next update, I’ll add an option to try harvest components instead of creating child actors. (Thanks to the code contribution from you and your team!)

Generate blueprint reference currently is stored inside prefab component but not in prefab asset. The original thought is that one prefab could be used to generate multiple version of blueprint. But that seems over-design and causing confusion. I’ll also change that in next update.

The “Ignore Actor Classes” is a great idea. Will working on that.

@Denis.Korkh

Sorry that somehow I totally missed your reply. For the scenario you described, I think maybe adding a new prefab usage window, containing a list of prefab actors, so artist can navigate through the list, and the level editor viewport will zoom to selected prefab actor automatically to make it easier to spot any placement issue.

Omg! I’m sorry I made it look like a bug :stuck_out_tongue: I got baited by our internal version of Prefab Tool!

The best thing would be that everything that is not an Actor Blueprint should be added as a component to the generated Blueprint (to includes things such as Sounds, Particle System etc…).

Okay, that make sense! If you implement the change we’re talking about we’ll have both options (by regenerating a new Blueprint if we want to create a new one from a Prefab we already created a Blueprint for).

Lighting speed answer as usual, thank you very much. I’ll probably add an update video to my tutorial series once it is done.

Good luck and have fun everyone :slight_smile:

whats the easiest way to delete everything in the prefab from the level with everything in it ? If you hit delete(keyboard) not in your prefab window it dumps everything out of the prefab into the world outliner - this is very frustrating = then you gotta select everything again and delete those - why ?? That action is totally counter -intuitive to what would be expected

With one or more prefabs selected in the World Outliner, look at the Details pane, find the “Prefab” section, and click the “Destroy Hierarchy” button.

I’m curious about the performance of Prefab Tool. My project has large maps with clusters of buildings that have been put into prefabs, and then a few (ten or less) copies of these clusters are scattered around the map. These building clusters in some cases are very large, with hundreds of static mesh actors inside. Making a change to one of these prefab instances in the world via Unlock and ApplyAndLock ends up taking in some cases hundreds of seconds (a few minutes). Is anyone else seeing this slowdown? Is it something I’m doing wrong? Is there any work being done on the plugin to bring this time down?

After doing some digging on performance, I found that most of the time was spent on repeated calls to StaticFindObject deep inside FPrefabGEditorAdapter::LevelFactory_FactoryCreateText::Local::ImportProperties. By caching the results of calls to StaticFindObject, I was able to bring down Apply times by an order of magnitude (from minutes to seconds). I’d be happy to send you a diff, if you want, or if you have a github repo, I can submit a PR. Cheers!

The Pivot Tool and this Mesh Tool is amazing!! a few questions:

  1. The Mesh Tool has a pivot tool, does it do all the things that the Mesh Tool’s pivot tools does, is one better that the other?

  2. I have 2 big blocks and when they are put together the light shines through the gap. I though that I was able to fix it doing something in the Mesh Tool but I cannot remember what I did. Is there an option in the Mesh Tool that fixes these types of issues?

  3. If a static mesh has 6 material slots can you remove all of them except o1?

  4. Can you create Collision with the Mesh Tool?

  5. Can you combine all materials into one material?

Thank you,
John

Prefab 1.1.1 with 4.20 support is now live on both itch.io and unreal marketplace.

Great job Nate, glad you are back and well :slight_smile:

  • hi, this buy can be to a group or it’s can be to a minigroup?.I buy it, but when i comit in proyect of git, my team cant be used.

JohnADaniels Thanks! :slight_smile:

SbstnDC Preab is a custom asset, if it’s used in a map, the plugin need to be installed locally to open the map properly. You can convert prefab actors to normal actors so the map can be opened without installing the plugin.

Prefab Tool 1.1.2 is now live on both itch.io and Unreal Marketplace.

Thanks [USER=“2026763”]Dan Brakeley[/USER] for reporting the performance issue and kindly providing code solution to improve the performance.

In a test map of applying prefab changes to 1,000 instances, the process time go from 15,520.371 ms down to 1,196.326 ms.

Change Log:

@Nate , LUV prefab tool, it’s what UE should do anyway I think… Although UE4 is a great achievement, there are some limitations to do with combining and instancing various types of objects, and PFT gets around all that.

One question: can I leave the project in a ‘prefabbed’ state, or is it best to convert everything to meshes / BPs before packaging?..

Thanks!

@Nate I noticed PT behaves strangely with ISMs. I had a lot of foliage ( manually placed and then converted to ISM with Instance Tool ) which I grouped into a prefab with other actors. They become invisible during editing, but visible during gameplay. Which means then light can’t be rebuilt…

:frowning:

Any info welcome - thanks.

Pete

@Nate : Hmmm, scratch that, it’s something weird to do with the grass ( just mesh, no foliage ) I’m using. But it does lose the lightmap info when I put it in a prefab… :-/

We downloaded the latest version of the Prefab tool from the Marketplace but we cannot manage to get its plugin to compile with our project which is on 4.20. Anybody else is seeing this?