-
-
Notifications
You must be signed in to change notification settings - Fork 146
Cleanup Texture2DConverter and fix typos in pyproject.toml #324
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
base: master
Are you sure you want to change the base?
Conversation
6660d27
to
3517281
Compare
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.
Sorry that I'm only replying now.
I will be blunt, I don't really see the point of this PR.
The typo fixes, doc string adjustments and the BC format collapsing are okay, but that's it.
TextureSwizzler.get_corrected_texture_format
is basically a one-time use function,
which only adds a layer of indirection without any benefit, as at one of the two places where it's being used, the same check has to be done again anyway.
TextureSwizzler.PlatformBlobType
is also not really useful.
The usage of bytes from before was actually wrong, as the platformblob type is defined by the Texture2D field of it, so just List[int] is enough.
The platform type also doesn't have to be narrowed down to BuildTarget,
as the only use of platform is in an equality check, which works just fine with an int as well.
3517281
to
9178ed7
Compare
Apologies - I didn’t fully considered the current needs, so I’ve decided to go ahead and revert the 3 changes you mentioned, to narrow the PR to only typo fixes. My initial intention with these changes was to centralize the logic and make the code more readable in the long run. But I understand that, the added abstraction doesn’t bring enough value and instead introduces unnecessary complexity. Thanks again for your constructive feedback - it’s much appreciated. |
This PR now contains:
with some new changes:
|
9178ed7
to
17f581b
Compare
Summary
This PR does some minor changes to Texture2DConverter.
platform_blob
can beList[int]
in newer version of Unity, instead of onlybytes
.platform_blob
type hint still usesbytes
, now corrected toList[int]
.if TYPE_CHECKING: assert xxx is not None
seems redundant, now removedif
.Pre-convertsplatform
toBuildTarget
enum.Wraps swizzle texture_format conversion into TextureSwizzler.image_to_texture2d
.Along with two typo fixes in the
pyproject.toml
:Fixes the invalid license field inpyproject.toml
which causes CodeQL failing.data-minig
inpyproject.toml
.