UE version is 4.7.2.
I’m experiencing following bug/problem: when i’m spawning blueprints in editor via editor extension written in c++, all blueprints are spawned with non-default values (two Boolean values, both must be set to false, but looks like they are set to true or constructor script didn’t executed) - this causes problem with editor freezing for unknown time (I have 4+ thousands of objects, most of them with particle systems - I was unable to wait for unfreezing). To make objects work properly I need to build the lightning.
Hey -
Just to make sure I understand, you’re saying that when you create a blueprint of a custom C++ class, the BP variable default is not being set to what the default value is in the class, is that correct? Have you noticed the same behavior with variable types other than bool (such as float or int32)?
Cheers
Hi!
Nope
I have blueprint with two variables (bools) and 8 objects: 4 meshes, 2 particle systems and two point lights. By default (when bools are false) - particle systems and light are turned off and not visible - this is expected behavior and this is done via construction script.
When i spawn this blueprint in editor - all spawned blueprints have variables set to false, BUT! particle systems and lights are visible.
And this is problem, because i’m spawning many blueprints, and editor hangs on.
I’m attempting to reproduce what you’re seeing and the setup sounds simple enough (variables & objects). My question is how does the code tie in? Is the blueprint based off of a custom code class and if so can you either supply the class’s header/source file or give me an idea of how it is setup in your project?
Thanks
Sorry for delay.
- Spawning blueprint in editor:
SpawnBlueprintFromPath(world, TEXT(“Blueprint’/Game/Dungeon/Tiles/Wall.Wall’”), loc, rot, SpawnInfo);
with
template <typename T>
static FORCEINLINE T* SpawnBlueprintFromPath(UWorld* MyWorld, const FString PathToBlueprint, const FVector SpawnLocation,
FRotator SpawnRotation, FActorSpawnParameters SpawnInfo)
{
FStringAssetReference ItemToReference(PathToBlueprint);
ItemToReference.TryLoad();
UObject* ItemObject = ItemToReference.ResolveObject();
if ((ItemObject) && (MyWorld))
{
UBlueprint* GeneratedBP = Cast<UBlueprint>(ItemObject);
return MyWorld->SpawnActor<T>(GeneratedBP->GeneratedClass, SpawnLocation, SpawnRotation, SpawnInfo);
}
else {
UE_LOG(DungeonBuilderWindowLog, Warning, TEXT("No object"));
return NULL;
}
}
Blueprint itself if simple:
8 Objects, 2 bool flags, only blueprint without code, after spawning it’s construction script not executed.
I hope this helps…
Hey -
Are the meshes, particle systems, and lights added to the blueprint through code or by using add component in the editor? Also, could you post the full code (source and header) for the class you’re using as well as a screenshot of your construction script?
Hi ,
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
Thank you.