How to use the SkeletalMesh User Asset Data

I would like to associate a string with each of my meshes.

I found the Asset User Data which sounded like it would do the job. I can add elements to the collection but I cannot edit the elements. Each element is read only and set to ‘None’

Is there anyway to edit these in the editor.

Thanks

64365-sm.png

I tried and tried to get something to work with this, but in the end I was unsuccessful. No matter what I tried (creating a sub-class of UAssetUserData in c++, etc) this element won’t populate, it doesn’t want any sub-class.

I ended up just adding an array of ints (which I needed for material reference purposes) directly to USkeletalMesh. What sucks is that with every release, I’ll have to re-add that parameter. But it is what it is, one line of code, no big deal.

If anyone has any way to use this property, I’d love to know.

Quite some time has passed, but I’ll post a solution here for anybody who stumbles upon this page in the future.

You’ll need to create a subclass of UAssetUserData to hold any properties you’d like to store. If you add the ‘EditInlineNew’ class specifier to your subclass, you’ll be able to create a new instance of the class within the dropdown menu pictured and modify the properties within the editor.

Necro, but this was partially helpful for me, with an additional note. I created a simple code plugin, added a header:

UCLASS(BlueprintType, editinlinenew, meta = (ScriptName = "PropUserData", DisplayName = "Prop User Data"))
class YOUR_API UPropAssetUserData : public UAssetUserData
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, Category = "Prop User Data")
	FString MyVariable;
};

The important elements for me were:

  • UClass flag BlueprintType for it to show up in-editor
  • UClass flag editinlinenew for it to editable at all, since the user asset arrays seem to always be ‘instanced’
  • UProperty flag EditAnywhere for the actual property to be editable in places like the static mesh UI.

Once the plugin was loaded ,the dropdown included the ‘PropUserData’ option, and expanding it let me edit my variable(s).