I have a c++ class containing 2 TArrays and extended it with a blueprint to edit easiliy the defaults values. After having created my blueprint, I tried to select it from the drop-down menu in one of my other blueprints, but it didn’t show up. Here is the code in my header file extended by the container blueprint :
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lullaby : Plants")
In the blueprint that I try to reference, I can clearly see the “Parent class : CropParamsMap” in the top right of the blueprint editor. This uclass is also specified as “Blueprintable”.
I think that the editor is not considering the blueprint as an instance of the UCropParamsMap class, but I am not sure.
Just to make sure I understand what you’re attempting, you have a blueprint based on a custom class where the 2 arrays are defined. You also have a second class that has a pointer to your first class. Then, from a blueprint of the second class, you attempt to reference the first in order to use the arrays, is that correct?
Thanks for the quick answer! Yes that’s exactly it.
When using the syntax described in your original post, the drop-down list will only populate with instances of the specified class that are present in the viewport. If you want to set your pointer to the blueprint itself rather than a specific instance of the blueprint, you’ll want to use
TSubclassOf rather than
Can’t believe I forgot that! For some reason I thought blueprints were considered to be instances of the base class. What I’ll do is simply change the type to
TSubclassOf and create an instance of the class at runtime.