Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Add metadata specifier to UPROPERTY/UCLASS/USTRUCT etc. #561

Open
kadium91 opened this issue Jun 13, 2024 · 5 comments
Open
Labels
Collaborators Discussion intended for collaborators enhancement New feature or request

Comments

@kadium91
Copy link

Hello, would it be possible to add metadata specifiers to dumped properties/classes/structs ? (I'm talking about the meta stuff like meta(ClampMin=..., ClampMax=...), you can find a sample on FColor.), also maybe add Category property specifier (if available, this might be exposed only to editor builds idk)

You have a sample of how to get metadata in "UField::GetMetaData" in Engine/Source/Runtime/CoreUObject/Private/UObject/Class.cpp

@UE4SS
Copy link
Collaborator

UE4SS commented Jun 13, 2024

Unfortunately the MetaData related functions and variables only exist in the UE editor, so the only way to do this would be to glean which specifiers are appropriate from the context of the property at runtime which can be difficult and inaccurate.
I appreciate letting us know where to look though, it's very helpful.

@kadium91
Copy link
Author

Unfortunately the MetaData related functions and variables only exist in the UE editor, so the only way to do this would be to glean which specifiers are appropriate from the context of the property at runtime which can be difficult and inaccurate. I appreciate letting us know where to look though, it's very helpful.

You're right, didn't saw that was marked EDITORONLY. There might be a way tho as I know some of metadata are used at runtime in production build.

@kadium91
Copy link
Author

Unfortunately the MetaData related functions and variables only exist in the UE editor, so the only way to do this would be to glean which specifiers are appropriate from the context of the property at runtime which can be difficult and inaccurate. I appreciate letting us know where to look though, it's very helpful.

After talking with a former epic employee here is what he told me about accessing metadata in shipping builds

Not without engine changes. Some metadata makes it into property flags but most doesn’t
Package level metadata can be promoted to asset registry tags without modifying the engine though

The specific metadata specifier I was interested to was AssetBundles btw. I think we could still get it apart from metadata since they are used at runtime for shipping builds. I'll look at it tmr.

@kadium91
Copy link
Author

kadium91 commented Jun 26, 2024

Hello there, I'm coming with some news. Retrieving the whole metadata specifiers may be possible on engine version below 4.19 (so 4.18). GetMetaData in UField is retrieving the metadata from UPackage's MetaData property, this property is marked as EDITOR_ONLY on version above 4.18 but isn't in 4.18, so the deal may be to recreate the GetMetaData function from UField (which is still marked as EDITOR_ONLY on 4.18) in order to get the metadata from UPackage->MetaData.

For comparisons here is a few links :

4.18

4.19 (same as current engine versions)

So yes it is possible, I know it's not really a BIG deal since it's for engine version below 4.18, but again it may be useful in my case (and a few peoples ig). I could run a old fortnite version on < 4.18 to know their metadata etc.

@narknon
Copy link
Collaborator

narknon commented Jun 26, 2024

It says it's NULL in the game.

@UE4SS UE4SS added Collaborators Discussion intended for collaborators enhancement New feature or request labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Collaborators Discussion intended for collaborators enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants