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

Assign extensions if the didn't exist already #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

keianhzo
Copy link
Contributor

We weren't assigning the extensoins back to the gltf object in case the map didn't exist

Copy link
Contributor

@Exairnous Exairnous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I'm pretty sure nothing else references get_hubs_ext so I think you can remove the function definition as well. Also, I don't think you need the existed property/check. I'm pretty sure you can assign the new dictionary immediately after defining it and then everything would work as if it were there all along and there wouldn't be the need for the extra variable/check.

However, what I've said above shouldn't affect any functional differences (they would just make the code nicer, IMO), so I'm approving these changes.

@keianhzo keianhzo requested a review from Exairnous June 26, 2024 10:08
Copy link
Contributor

@Exairnous Exairnous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment that I'll let you determine what to do with, the rest looks fine.
Approving.

Comment on lines +154 to +157
if type(gltf2_object) is tuple:
gltf2_object[0].extensions = extensions
else:
gltf2_object.extensions = extensions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but it seems kind of hard to reason about to me.
Are you sure this shouldn't be up under the if extensions is None: block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants