-
Notifications
You must be signed in to change notification settings - Fork 316
Detangle some material generation logic from CesiumFeaturesMetadataComponent
#1628
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
Conversation
This should be ready for a review, provided CI passes this time ^_^ |
CI is now passing thanks to #1649 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just minor comments that might not even require any action.
@@ -25,7 +26,7 @@ | |||
|
|||
using namespace CesiumTextureUtility; | |||
|
|||
namespace CesiumEncodedFeaturesMetadata { | |||
namespace EncodedFeaturesMetadata { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably fine, but we do need to keep sight of the fact that even private types pollute a global namespace in Unreal builds. In shipping builds, every symbol - public or private, across all plugins/modules - get dumped into one executable. So if we have a class name that conflicts with one in some other plugin, users may get linker errors when they combine the two plugins.
I'm remembering now that there's a line in our style guide saying private types shouldn't be prefixed with Cesium
. That reflects our common practice, but I think it may not have been a well-considered choice. It's fine as long as conflicts are unlikely.
I think if I were starting over with Cesium for Unreal today, I'd probably put everything in a CesiumForUnreal
namespace (except maybe UObjects? I'm not sure) in order to avoid the issue entirely.
But anyway, the chance of conflict in this particular case is really low, so I'm fine with the rename. I just wanted to mention it so we don't go renaming all the private types.
Thanks @kring for the review! I was able to reproduce the bug you found. Stepping through the debugger -- it looks like some tiles actually have a "valid" I'd still like to step through and see how those Int8 properties are being initialized -- it might be a bug in cesium-native, for instance -- but I think this is just demonstrating the fundamental flaw in the "Auto Fill" system, because it simply picks up the first type definition it finds. |
Thanks @j9liu! |
A lot of the boilerplate in
CesiumFeaturesMetadataComponent
is necessarily entangled, but there are some parts that can be moved out and made reusable. I also made some changes to file names in accordance with our style guide.This PR does the following:
GeneratedMaterialUtility
namespaceCesiumFeaturesMetadataComponent.cpp
for the changesCesium
fromEncodedFeaturesMetadata
, since it isn't public APICesium
fromEncodedMetadataConversions
, since it isn't public API