Seperate CDO's from an array?

Hello! I have used UObjectLibrary::LoadBlueprintsFromPath() to generate a list of blueprints in a folder.
However, it turns out this list includes both the CDO and the blueprints themselves.

I would like to seperate them into two different arrays (preferably with indexes matching their respective counterparts), how would I accomplish this?

Might just need to check IsTemplate() on the objects. CDOs are templates.

1 Like

Ok, so just do a for loop for each index and then add all that trigger IsTemplate() to a new array, and those that return false to another should work right? But how about making sure they match up so that I don’t get default info from a different blueprint than the one I’m spawning?

I’m thinking if each of the entities have for instance a name, I should be able to just match those up, right?

Not sure what you want to achieve… spawn all blueprints in a folder?

Yeah, but I also want to check their default values to determine which one to spawn.

Rather than trying to match them up, you can just call ->GetDefaultObject<Type>() on the UClasses, where “Type” is whatever pointer type you want (like AActor or UObject). To go the other way, you’d do ->GetClass() on the CDOs.

1 Like