Announcement

Collapse
No announcement yet.

Prefab Tool - Prefab Support for Unreal Engine

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

    #61
    [MENTION=702]Nate[/MENTION], Thanks! If we get a reproduction case, I'll let you know.

    Comment


      #62
      [MENTION=702]Nate[/MENTION], congratulations on getting Prefab Tool in the Marketplace - I just pick up a copy myself .

      Any updates on converting prefab to actor blueprint?
      [WIP] Procedural City Generator
      [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
      [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds
      Join our Discord

      Comment


        #63
        Originally posted by CoquiGames View Post
        [MENTION=702]Nate[/MENTION], congratulations on getting Prefab Tool in the Marketplace - I just pick up a copy myself .

        Any updates on converting prefab to actor blueprint?
        Thanks!

        It's still in planning stage (been distracted from migrating to 4.17 release), I will start the implementation next week.
        | twitter | github | #ue4tip

        Comment


          #64
          Originally posted by Nate View Post
          Thanks!

          It's still in planning stage (been distracted from migrating to 4.17 release), I will start the implementation next week.
          Good to hear! Thanks!
          [WIP] Procedural City Generator
          [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
          [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds
          Join our Discord

          Comment


            #65
            [MENTION=702]Nate[/MENTION], We have a reproduction case for the Rename crash. The problem seems to revolve around sub-levels.

            Make sure bUpdateAllPrefabActorsWhenOpenMap = true

            1. Create a new map/level. Call it MapA
            2. In this level drop an actor and name it TestName.
            3. Make this actor into a prefab.
            4. Save MapA.
            5. Create a new map/level. Call it MapB.
            6. Drop a new actor and ALSO name it TestName.
            7. Make this actor into a prefab.
            8. Save MapB.

            At this point, you have two maps each with a prefab that has an actor with the same name as the other. This example has two different prefabs, but if you use the same prefab in each map, I believe you'll get the same result.

            9. Create a new map/level. Call it WorldMap.
            10. In the Levels window, add in MapA and MapB.
            11. Save.
            12. Exit and restart (so map load happens and bUpdateAllPrefabActorsWhenOpenMap happens).
            13. Crash.

            I hope this lets you find the problem!

            Comment


              #66
              [MENTION=702]Nate[/MENTION],

              I dug around a bit in the code and I think I may have found the problem. I'm not very knowledgeable about this stuff in Unreal , so I might be off base.

              The intent of RevertPrefabActor is to replace an existing prefab actor's hierarchy with the one defined in the asset. To do this, it collects a bunch of information about the particular instance and then calls SpawnPrefabInstances to get a new hierarchy to replace the old one. Eventually, ReplacePrefabInstances is called to rename the new actors to their original names. Although the rename code here looks good, somehow a name conflict happens and it crashes.

              Although the rename code in ReplacePrefabInstances looks clean, it still dies when using multiple sublevels. When debugging, I noticed that the new actors weren't in the expected level. They were in the base map, not the sub level.

              So, I went to look at how they were spawned. SpawnPrefabInstances calls edactPastSelected, which pastes the new actors into the World's current level. So, I decided to set the World's current level before calling SpawnPrefabInstances. Here is my hack/fix:

              at approximately PrefabToolHelpers.cpp:1804
              Code:
              			// Spawn prefab instances
              			TArray<AActor*> SpawnInstances;
              			TArray<AGroupActor*> NewGroupActors;
              			PrefabActor->GetLevel()->OwningWorld->SetCurrentLevel(PrefabActor->GetLevel());
              			SpawnPrefabInstances(Prefab, PrefabActor->GetLevel()->OwningWorld, SpawnInstances, &NewGroupActors);
              			PostSpawnPrefabInstances(Prefab, SpawnInstances, PrefabActor, &NewGroupActors);
              This seems to keep the crash from happening. Previously, the new objects were all going into the base map but I think MakeUniqueObjectName makes a unique name in the outer of the old actor. But the place we're pasting into isn't in that context. So we can step on our own toes. This poited out that those actors might not have been created in the right level anyway. So, by fixing the level they are spawned in, it fixes the problem.

              At least that's the theory. :-) Let me know if there's a more appropriate fix or if I'm just off-base.

              Cheers,
              poz

              Comment


                #67
                [MENTION=221987]ColdIronPoz[/MENTION], thanks a lot for the reproduction case and the bug hunting! You're absolutely right about the root cause of the bug: the wrong assumption of current level of world is the same as the prefab actor's outter level.

                I'm preparing a hot-fix release now.
                | twitter | github | #ue4tip

                Comment


                  #68
                  1.0.3.1 update live on itch.io. Unreal marketplace update submitted.

                  1.0.3.1 Change Log
                  1.0.3.1
                  ------------------
                  * Fix potential editor crash due to name clash when reverting prefab Actor in multi-levels map (thanks ColdIronPoz for the report and fix)
                  * Fix apply prefab actor only works if world's current level is the same as prefab actor in multi-levels map
                  * Drop 4.14 support
                  | twitter | github | #ue4tip

                  Comment


                    #69
                    [MENTION=702]Nate[/MENTION],

                    Thanks for the fix! We've deployed it and is seems to be working well.

                    One unrelated thing: The prefab plugin doesn't compile properly in non-unity builds. Mostly it's missing some headers in cpp files. But a harder fix is that PrefabComponentDetails.cpp calls FPrefabAssetEditorModule::ShowHidePrefabActor. But that class and function is only defined in PrefabAssetEditorModule.cpp. I think the class will need to be hoisted up to a header for it to compile.

                    (We're preparing our code for IWYU, so we're doing some non-unity builds to make sure we're doing the proper includes.)

                    Comment


                      #70
                      [MENTION=221987]ColdIronPoz[/MENTION], thanks for letting me know the compile issue in non-unity build, I'll push a update for that.
                      | twitter | github | #ue4tip

                      Comment


                        #71
                        Any news about Prefab-to-BP actor (and back) conversion ?

                        Comment


                          #72
                          Originally posted by motorsep View Post
                          Any news about Prefab-to-BP actor (and back) conversion ?
                          Working on that, hopefully I can wrap it up this weekend. (The first implementation will only support prefab -> BP actor conversion though)
                          | twitter | github | #ue4tip

                          Comment


                            #73
                            Originally posted by Nate View Post
                            Working on that, hopefully I can wrap it up this weekend. (The first implementation will only support prefab -> BP actor conversion though)
                            I am thinking of this kind of scenario: make Prefab > convert it into BP actor > edit and update Prefab > BP actor automatically gets updated. Is it something that you plan on having in the first iteration of the feature ?

                            Comment


                              #74
                              [MENTION=702]Nate[/MENTION],

                              Now that we've been working with this a little bit, we've run across some workflow speed-bumps and thought you might have some ideas about how to overcome them. Or maybe take them as suggestions for future updates.

                              It's not obvious when you select an actor that it is part of a prefab. I've moved stuff around, saved, and when I re-opened the map the changes are lost because the Prefab is still connected. I can imagine a few ways to approach this workflow problem. One would be to have the actors in the prefab be Grouped using Unreal's editor groups and have that Group be locked as long as the Prefab is connected. When you try to choose an actor that's inside that prefab, you'd know immediately that you were doing so. To move things inside the prefab, you'd have to disconnect it. (I assume this behavior would need to be an option for people with other workflows.)

                              In our workflow, most prefabs should be disconnected because we always tweak the items in it a bit. But by default, dropping in a prefab leaves it connected. There are also times where we do want it connected. It turns out that some prefabs are meant to be used one way and others the other way. So, maybe we could mark a Prefab asset as "is disconnected by default." (Internally, we call these kinds of prefabs "Stamps", because you stamp them into the map.) (Or maybe they shouldn't even be connected any more; I'm not sure about that.)

                              One more requests since I'm here: Select all siblings/children - If you have a prefab selected, select all the children. If you have a prefab child selected, select all the siblings.

                              Thanks again for this tool. It is really great.

                              Comment


                                #75
                                1.0.4 update now live on itch.io. Marketplace update submitted.

                                Change Log:

                                1.0.4
                                ------------------
                                * Add experimental Blueprint generation support
                                * Support non-unity build
                                | twitter | github | #ue4tip

                                Comment

                                Working...
                                X