Announcement

Collapse
No announcement yet.

Prefab Tool - Prefab Support for Unreal Engine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic [RELEASED] Prefab Tool - Prefab Support for Unreal Engine

    Prefab Tool - Prefab Support for Unreal Engine

    Click image for larger version

Name:	prefab_tool_960x422.png
Views:	1
Size:	177.8 KB
ID:	1221381

    Prefab Tool is available on itch.io and Unreal Marketplace

    Hi, I've been working on a Prefab solution for Unreal Engine: Prefab Tool.

    Prefab Tool is inspired by the article: BUILDING THE OPEN WORLD FOR DEAD ISLAND 2 WITH UNREAL ENGINE 4, also the Prefab in UDK.

    Click image for larger version

Name:	PrefabTool_screenshot_01.jpg
Views:	1
Size:	200.4 KB
ID:	1221382

    Click image for larger version

Name:	PrefabTool_screenshot_02.jpg
Views:	1
Size:	193.0 KB
ID:	1221383

    Click image for larger version

Name:	PrefabTool_screenshot_03.jpg
Views:	1
Size:	261.3 KB
ID:	1221384

    Click image for larger version

Name:	PrefabTool_screenshot_04.jpg
Views:	1
Size:	189.1 KB
ID:	1221385

    Click image for larger version

Name:	PrefabTool_screenshot_05.jpg
Views:	1
Size:	184.3 KB
ID:	1221386

    Click image for larger version

Name:	PrefabTool_screenshot_06.jpg
Views:	1
Size:	180.1 KB
ID:	1221387

    Click image for larger version

Name:	PrefabTool_screenshot_07.jpg
Views:	1
Size:	144.4 KB
ID:	1221388

    Feature List:
    • Create Prefab from collection of actors in the level
    • Nested Prefab to support complex scene hierarchy
    • Preview Prefab Thumbnail in Content Browser and Detail View
    • Drag and drop Prefab into the level to instantiate actors collection
    • Edit Prefab directly inside level editor
    • Apply changes of Prefab to all Prefab instances
    • Revert changes of Prefab instances
    • Convert Prefab instances to normal actors
    • Destroy Prefab Actor with option to destroy whole hierarchy
    • Swap Prefab Asset anytime
    Last edited by Nate; 08-14-2017, 12:12 PM. Reason: Release on unreal marketplace

  • replied
    Hey Nate! Firstly thanks for the excellent plugin.

    I'm in the process of updating from 4.19 to 4.21, and one problem we're having is that all/most of our prefabs crash when FPrefabToolEditorUtil::RevertPrefabActor() runs on map load. Ultimately, the crash happens in FPrefabGEditorAdapter::LevelFactory_FactoryCreateText() while trying to parse all the objects stored in the prefab actor.

    We believe this is due to some physics classes that were moved and renamed as part of 4.21, and so since the tool works by using the copy/paste functionality, those references can't be correctly fixed up (and therefore can't be parsed!). I've tested and confirmed that I can fix individual prefabs by disabling the revert on map load, and then going to a map that has the prefab placed within it and hitting Apply to push the properly fixed-up version back to the uasset.

    My question is: has this ever come up in previous engine version upgrades? Based on my limited understanding of the problem, this seems like it would be an issue anytime Epic made significant changes to class names in an engine update. Is there some existing functionality or commandlet I can use to re-serialize all of our prefabs so that they'll get properly fixed up? Thank you for your time!

    Leave a comment:


  • replied
    Well, I've taken a couple stabs at this, and both involved changes to the engine to work (we're on UE 4.19 at the moment). If anyone reading this is also willing to alter the engine to get this working, here's the summary:

    1. In FPrefabToolEditorUtil::ReplacePrefabInstances, as we iterate over ActorsToReplace, I find the AInstancedFoliageActor* for the Actor's Level, and I tell it to temporarily early out in OnLevelActorMoved and OnLevelActorDeleted (first engine change).

    2. At the end of that same for loop, I turn OnLevelActorMoved and OnLevelActorDeleted back on, and I add the AInstancedFoliageActor* to a TSet.

    3. Immediately after the for loop, I iterate through the TSet of AInstancedFoliageActors and call a new function ReplaceMissingBases (second engine change). ReplaceMissingBases is based off AInstancedFoliateActor::MapRebuild, but instead of looking for bases with UModelComponents, I'm looking for bases with null component. Also, MapRebuild uses LineTraceSingleByObjectType, which unfortunately collides with LODs, which is not at all what I want, so I use LineTraceMultiByObjectType instead, and then cull out anything I don't want to collide with (see AInstancedFoliageActor::FoliageTrace for the example I pulled from).
    Last edited by ProleDanBrakeley; 12-21-2018, 11:10 AM.

    Leave a comment:


  • replied
    Originally posted by Nate View Post
    Hi Dan, foliage support was purposedly disabled as I ran into some issues in the implementation. I'll re-eval the problem and see if can come up with proper solution this time. Will keep you updated. Thanks for bringing it up.
    I'm going to be taking a look at the code this week as well, as our artists really want this. I'll let you know what I find!

    What did you mean by "foliage support was purposely disabled"? Are you doing something in your code to ensure foliage gets destroyed cleanly?

    Leave a comment:


  • replied
    Hi Dan, foliage support was purposedly disabled as I ran into some issues in the implementation. I'll re-eval the problem and see if can come up with proper solution this time. Will keep you updated. Thanks for bringing it up.

    Leave a comment:


  • replied
    Hey Nate, I've got a new issue for you, this time with painted foliage. I was able to repro it in UE 4.20.3 with PrefabTool version 1.2.1.1.

    Repro:
    1. In a new scene, create a new prefab with some meshes (I just used the table and chairs from the Starter Content).
    2. Switch to the Foliage Painter mode (shift+4)
    3. Add some foliage and then paint it on to the meshes in your prefab.
    3. Return to normal mode (shift+1)
    4. "UnLock" the prefab.
    5. "Apply and Lock" the prefab.

    Result:
    Any foliage that was painted on to the prefab's meshes disappear (foliage painted to non-prefab meshes remain).

    Expected:
    Foliage painted to a prefab remain after an "Apply and Lock" operation.

    Leave a comment:


  • replied



    1.2.1 Changelog

    1.2.1
    ------------------
    - Add Launch Proefab Tool Window button to prefab component detail panel
    - Now can attach selected actors to last selected prefab actor with Attach in Prefab Tool Window
    - Now always draw component visualizer for target actor even it's not selected​
    - Now can toggle Prefab View Visualizer in Prefab Tool Window
    - Color column of world outliner and prefab component visualizer now shows prefab actor with prefab un-assigned in yellow color
    - The Color of world outliner prefab color column and prefab component visualizer is customizable now
    - Mark Target now implicit make prefab's level current (and restore after UnMark)
    - Destroy in Component Detail now is Destroy Keep Children and working; Remove Destroy Hierarchy since it's default behavior now
    - Add hotkey Ctrl+Shift+End for snap selected prefab actor to floor
    - Disable most operation in Prefab Tool Window when Prefab is disconnected​
    - UnMark and Lock prefab actor in Prefab Tool Window now will select prefab actor afterward
    - Fix bug that prefab actor instance's layer visibility been set to visible after spawn
    - Fix bug that changes of instance actors' attachment not been properly reflected after apply/revert
    - Fix Prefab View Visualizer flickering issue in some cases
    - Fix Toggle Isolate only works properly while initial isolated prefab actor is selected
    1.2.0 Changelog
    1.2.0
    ------------------
    - Add Prefab View Visualizer to visualize prefab usage in level editor viewport
    - Add a sortable color column in World Outliner to indicate Prefab Actor Status (Lock/UnLock/Connected/Disconnected)
    - Add Prefab Tool Window
    - Add Mark Prefab Actor as Target Prefab Actor option, new actors will be added to a Target Prefab Actor
    - Add Toggle Isolate option to isolate current editing prefab actor in level editor viewport
    - Add New Empty Prefab option and mark it as Target
    - Add Set Prefab Pivot option to change prefab pivot base on current widget location or it's bounding box
    - Add option to move actors to compensate pivot changes after Set Prefab Pivot
    - Add proper Snap to Floor option to snap prefab actor to floor base on bounding box or pivot
    - Add ability to Lock and Collapse all Prefab Actor in World Outliner
    - Add Save/Save As in Prefab Tool Window to quickly save or duplicate current Prefab Asset
    - Add Attach/Detach in Prefab Tool Window to quickly add/remove actors to current Prefab Actor
    - Add an option in Prefab Editor Setting to always display Prefab Component Visualizer even it's not selected
    - Delete a prefab actor now also delete all it's children actors by default! (Old behavior will leave it's children intact)
    - Now lock a prefab actor (by clicking on lock widget) or click a locked prefab actor in level editor will also make it collapsed in World Outliner
    - Move prefab actor to another level now works properly (without leaving it's children behind)
    - Focus on prefab actor with F key works better since since prefab component calc bounds dynamically base on children now
    - Now try to rebuild render data of ISM/HISM actors inside Prefab when it's spawned
    - Add PrefabVersion field to PrefabAsset for future prefab format change​​
    - Thanks Nathan Cheever and Mateusz Piaskiewicz for feature suggestions and feedbacks during 1.2.0 development!

    Leave a comment:


  • replied
    motorsep here're the steps to integrate code plugins from marketplace to your own custom build:

    1. Download the closest engine version (which your custom build base on) of plugin from marketplace. e.g. your custom engine build is fork from 4.20, then download 4.20 version of the plugin
    2. Copy the plugin folder from launcher build's plugins folder to your custom build's plugins folder
    e.g. copy "C:\Program Files\Epic Games\UE_4.20\Engine\Plugins\Marketplace\PrefabTool" folder into "E:\CUSTOM_UE_BUILD\Engine\Plugins\SOME_FOLDER\PrefabTool"
    3. Run "GenerateProjectFiles.bat" in your custom engine build folder to re-generate UE4.sln
    4. Build UE4.sln in visual stuidio

    And you might also want to alter the .uplugin file to include/exclude the targeting platforms:

    e.g. one of my client are using PrefabTool in a Switch project which is not enabled by default, you can open "PrefabTool.uplugin", find the "WhitelistPlatforms" line:

    Code:
    {
          "Name": "PrefabAsset",
          "Type": "Runtime",
          "LoadingPhase": "Default",
          "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "Android", "Linux" ]
        },
    Append "Switch" to the "WhitelistPlatforms" field

    Code:
    {
          "Name": "PrefabAsset",
          "Type": "Runtime",
          "LoadingPhase": "Default",
          "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "Android", "Linux", "Switch" ]
        },
    Then rebuild the engine.

    Leave a comment:


  • replied
    Nate

    I am using custom engine build and I am wondering if it's possible to use your tools with it (and how?!). Thanks beforehand

    Leave a comment:


  • replied
    tib_hou you can leave project in prefab state since prefab actor is essentially an empty actor in runtime (while has "prefab" behavior in editor).

    WES_Julien Have you downloaded 4.20 version of Prefab Tool from Marketplace? Unreal marketplace servers corresponding version of plugin for different engine version. So if you have to use 4.20 engine in the launcher to download 4.20 version of the plugin.

    Leave a comment:


  • replied
    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?

    Leave a comment:


  • replied
    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!

    Leave a comment:


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

    Thanks Dan Brakeley 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:
    1.1.2
    ------------------
    - [Performance] Now resolving Archetype from cache first (Thanks Dan Brakeley for code contribution)
    - [Performance] Delay spawned Prefab actor instances' references replacement
    - [Performance] Disable warning if destination level is hidden when spawning prefab instances
    - Apply Prefab changes on large map should expect ~10x speed improvement
    - Fix bug Prefab actorss not been refreshed when level is added to the world via UWorld::AddToWorld (Thanks Dan Brakeley for code contribution)
    - Fix bug duplicating Prefab asset not generating new prefab id
    - Refator PrefabGEditorAdapter out of PrefabToolHelpers

    Leave a comment:


  • replied
    JohnADaniels Thanks!

    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.

    Leave a comment:


  • replied
    • 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.


    Leave a comment:

Working...
X