Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix Float/Double meta data options not showing up. #6

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

BenVlodgi
Copy link
Collaborator

@BenVlodgi BenVlodgi commented Jan 11, 2024

Unreal Engine Version: 5.3

I didn't test in other engine versions.

Bug

Metadata keys which explicitly supported Float/Double/Real types do not show up. (i.e. SliderExponent, Delta, Multiple, NoSpinbox)

Cause

In UE 5.3 Floats and Doubles are actually Reals, with the subtype of Float/Double. These keys were failing to be supported because Key.DoesSupportProperty(Property) would return false. Because it requires the type and subtype to match.

Fix

  • The config was updated to initialize
    • floats as { UEdGraphSchema_K2::PC_Real, UEdGraphSchema_K2::PC_Float }
    • doubles { UEdGraphSchema_K2::PC_Real, UEdGraphSchema_K2::PC_Double }
    • With no extra { UEdGraphSchema_K2::PC_Real }
  • The constructor for the struct was updated to FixUp() the values if they are being initialized incorrectly by code.
  • The config was updated to also call FixUp() on PostInitProperties() so that configurations which were saved with previous versions would be fixed also.

Tested

  • Picking double type in the plugin settings menu already correctly set the type & subtype.
  • I verified: The new initializing of floats/doubles in the config fixes the issue.
  • I verified: Loading an old broken config gets fixed.
  • I verified: Adding the type's in code the old way gets automatically fixed.
    • Adding a naked float/double gets fixed.
    • Adding a naked real gets set to be a double.
    • Duplicates are automatically removed (because it is a TSet).

Metadata Keys which specifically supported Float & Double types were not showing up in.
This was the case in 5.3. I didn't test in other engine versions.
This was because a Floats and Doubles are actually Reals, with the subtype of Float/Double. These keys were failing to be supported because `Key.DoesSupportProperty(Property)` would return false. Because it requires the type and subtype to match.

The config was updated to initialize these as `{ UEdGraphSchema_K2::PC_Real, UEdGraphSchema_K2::PC_Float }` and `{ UEdGraphSchema_K2::PC_Real, UEdGraphSchema_K2::PC_Double }`

The constructor for the struct was updated to `FixUp()` the values if they are being initialized incorrectly by code.

The config was updated to also call `FixUp()` on `PostInitProperties()` so that configurations which were saved with previous versions would be fixed also.
@DoubleDeez DoubleDeez merged commit 7eca065 into DoubleDeez:main Jan 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants