Download

Modify PirmaryDataAsset Subclass Via Python

I have a subclass of UPrimaryDataAsset and have created various blueprints of the class within in the editor.

class GAME_API UMyItemClass : public UPrimaryDataAsset
{
    # ....
}

I’m wondering if there’s a means of editing the default properties of the blueprint classes.

asset = unreal.load_asset('/Game/.../MyItemSubClass_BP.MyItemSubClass_BP_C')
print (type(asset))
# None

asset = unreal.load_asset('/Game/.../MyItemSubClass_BP.MyItemSubClass_BP')
print (type(asset))
# Blueprint

The Blueprint class won’t have the properties of the asset and I cannot seem to locate the correct object which allows me to modify it’s properties. Is there any means of accessing the constructed class like this?

Cheers

you should use unreal.find_object to get the compile object.

asset = unreal.find_object(None,'/Game/.../MyItemSubClass_BP.MyItemSubClass_BP_C')
print (type(asset))
# BlueprintGeneratedClass
1 Like