You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~/.venv/lib/python3.13/site-packages/UnityPy/helpers/MeshHelper.py:165, in MeshHandler.process(self)
159 if mesh.m_Use16BitIndices is not None:
160 self.m_Use16BitIndices = bool(mesh.m_Use16BitIndices)
161 elif (
162 self.version >= (2017, 4)
163 or
164 # version == (2017, 3, 1) & patched - px string
--> 165 self.version[:2] == (2017, 3)
166 and mesh.m_MeshCompression == 0
167 ):
168 self.m_Use16BitIndices = mesh.m_IndexFormat == 0
169 self.copy_from_mesh()
File ~/.venv/lib/python3.13/site-packages/UnityPy/helpers/UnityVersion.py:91, in UnityVersion.__getitem__(self, idx)
89 elif idx == 4:
90 return self.type_number
---> 91 raise IndexError("Invalid UnityVersion index")
IndexError: Invalid UnityVersion index
The current UnityVersion.__getitem__ implementation does not support slicing, and always raises index error.
In this PR I did not change the (2017, 3) condition (I think it would still be better to add explicit parentheses because of the mixed and and or conditions) and instead added slice support.
Thanks, I missed the slice issue somehow.
And you're right, some explicit parentheses would be better at that place.
You can make a PR for it as well if you want, or I will add it at some point when I rewrite the mesh code.
Which should be soonish, as I plan to replace the python arrays with native arrays with typed sizes, likely via numpy or lighter via memoryviews, so that numpy isn't a dependency.
I have run into another issue with the mesh exporter that I am trying to debug right now. For some reason, some meshes are still failing to export with ValueError: Vertex data access out of bounds error. They work fine with AssetStudio tho. Sample: Login.unity3d.zip
I will investigate further first and, if successful, submit a PR with the necessary adjustments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
I encountered an issue exporting meshes from a bundle with UnityVersion 5.3p6.
Sample: bundle_5.3p6.zip
Using the following minimal example:
I get this error:
The current
UnityVersion.__getitem__implementation does not support slicing, and always raises index error.In this PR I did not change the (2017, 3) condition (I think it would still be better to add explicit parentheses because of the mixed
andandorconditions) and instead added slice support.