[MENTION=702]Nate[/MENTION], Thanks! If we get a reproduction case, I'll let you know.
Announcement
Collapse
No announcement yet.
Prefab Tool - Prefab Support for Unreal Engine
Collapse
X
-
[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 | RPG AI
[MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
[FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds | Procedural Buildings
Join our Discord
Comment
-
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?
It's still in planning stage (been distracted from migrating to 4.17 release), I will start the implementation next week.
Comment
-
Originally posted by Nate View PostThanks!
It's still in planning stage (been distracted from migrating to 4.17 release), I will start the implementation next week.[WIP] Procedural City Generator | RPG AI
[MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
[FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds | Procedural Buildings
Join our Discord
Comment
-
[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
-
[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);
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
-
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
Comment
-
[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
-
Originally posted by Nate View PostWorking on that, hopefully I can wrap it up this weekend. (The first implementation will only support prefab -> BP actor conversion though)
Comment
-
[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
Comment