Announcement

Collapse
No announcement yet.

Prefab Tool - Prefab Support for Unreal Engine

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

    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?

    Comment


      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 prole_brakeley; 12-21-2018, 11:10 AM.

      Comment


        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!

        Comment

        Working...
        X