GLTF: Move unique name generation code to GLTFState #80803
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves the
_gen_unique_name
method from GLTFDocument into GLTFState and renames it togenerate_unique_name
. Without this PR, it is not possible for GLTFDocumentExtension classes to generate unique names, so it's not possible to provide the same uniqueness guarantee as GLTFDocument itself.This PR also cleans up the code a bit, replacing the
while (true)
andbreak;
code with a simplefor
loop. I tested it and it functions exactly the same as before, just now the code is easier to read.Note: Per Lyuma's request, I have removed the exposing in this PR, so this PR is just moving the method and making it available to in-engine C++ code. We can expose it in a future PR.