Download

Class members marked with UPROPERTY() not showing up in Details Pane

I have a class that subclasses UMaterialInstanceConstant. I am trying to add a UPROPERTY that is a TArray<UTexture2D>. I have added it to the class how I have added every other UPROPERTY in my time working with Unreal, but for some reason, this will not appear in the Details pane. The functionality I’m trying to achieve is the user opens the editor for this Custom Material Instance, and Is able to select 1 or more textures to store in this TArray.
MaterialInstance:


UCLASS()
class UCustomMaterialInstance : public UMaterialInstanceConstant
{
public:
GENERATED_UCLASS_BODY()

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = MaterialEditorInstanceConstant)
TArray<UTexture2D> texs;

void Load();
void Save();


friend class UCustomMaterialInstanceFactoryNew;
};

Factory and AssetActions Classes work as they should, but I suspect the culprit could lie in the follow AssetActions Function:


void FAssetTypeActions_CustomMaterialInstance::OpenAssetEditor(const TArray<UObject*>& InObjects, TSharedPtr<IToolkitHost> EditWithinLevelEditor)
{
EToolkitMode::Type Mode = EditWithinLevelEditor.IsValid() ? EToolkitMode::WorldCentric : EToolkitMode::Standalone;

for (auto ObjIt = InObjects.CreateConstIterator(); ObjIt; ++ObjIt)
{
auto MIC = Cast<UMaterialInstanceConstant>(*ObjIt);
if (MIC != NULL)
{
IMaterialEditorModule* MaterialEditorModule = &FModuleManager::LoadModuleChecked<IMaterialEditorModule>("MaterialEditor");
MaterialEditorModule->CreateMaterialInstanceEditor(Mode, EditWithinLevelEditor, MIC);
}
}
}

I believe that this may be happening because I am loading the “Material Editor”, rather than some custom asset editor, but I doubt it because I am passing in the object with the UPROPERTYies at the end, so the editor should be aware of these properties and dynamically create the details view.

You don’t have a * in your texture TArray declaration, but I guess that’s just a typo in your post? Pretty sure that code wouldn’t even compile.

Anyway detail panels aren’t all created equal. The material instance editor uses a customization on its internal details panel that changes how properties are shown. It may be that it simply doesn’t support derived classes. Generally, the major engine asset types have not been coded with user inheritance/extension in mind; the associated asset editors even less so.

@kamrann Yeah, the missing * is a typo. I just switched to the default asset editor and everything is showing up now. Thanks for letting me know I can’t customize the major built in editors, saved me a lot of wasted time.