Useful Stuff
Breif Description
I've encountered a persistent issue in MidVoxIO where transformations fail to apply under specific conditions. This results in the error message "_t in nTRN not match models, transform not applied." The issue arises in two main scenarios:
When the .vox file contains groups of models.
When an object's position in all of x, y, and z coordinates is set to 0.
Steps to Reproduce:
- Create or modify a .vox file in MagicaVoxel, ensuring it contains groups or has an object at the origin (0,0,0).
- Process the file using MidVoxIO.
Expected Behavior:
Transformations should apply correctly to all models, including those within groups or positioned at the origin.
Actual Behavior:
The specified error message appears, and transformations are not applied as expected.
Me Rambling
Further Musings
In these scenarios, the Vox class is aware of the transforms as well as the groups and is correctly reading them from the vox file. It appears that how it is written there is no support for groups.
I'm unsure if this is intended and considered as being in-scope or if this is something that hasn't been touched on yet. If handling groups is something that is planned for the future, the hardstop if statement in vox.py could be written.
if len(transforms) != len(self.voxels):
print(f"_t in nTRN not match models, transform not applied")
return
As it is written now, when objects are in groups and when objects have no explicit transform (such as when they're at the origin) the _trans method of the Vox class won't combine two models.
Possible Tempoary Band-Aid
Temporary band-aid is a gross nested-if to still allow Vox class to at least attempt to combine the models. Though, this will obviously result in the models likely being in the incorrect orientaion or having some other unexpected transforms.
def _trans(self, transforms):
"""Transform all models and merge into one"""
if len(transforms) != len(self.voxels):
print(f"_t in nTRN not match models")
if len(transforms) < len(self.voxels):
# Notify that _t in nTRN not match models and weird errors may occur but will still proceed
...
if len(transforms) > len(self.voxels):
# Notify that groups are not currently supported
return
Long-Term Solution
For a sustainable resolution, MidVoxIO would need to integrate comprehensive support for group transformations. This enhancement would entail developing the capability within the Vox class to accurately recognize and process group hierarchies, applying transformations recursively from groups down to their child models. Implementing this feature would not only align MidVoxIO more closely with the .vox format's complexities but also significantly improve its utility for users dealing with advanced modeling scenarios. Such an improvement would mark a significant step forward in making MidVoxIO a more versatile and powerful tool for voxel model manipulation.
Useful Stuff
Breif Description
I've encountered a persistent issue in MidVoxIO where transformations fail to apply under specific conditions. This results in the error message "_t in nTRN not match models, transform not applied." The issue arises in two main scenarios:
Steps to Reproduce:
Expected Behavior:
Transformations should apply correctly to all models, including those within groups or positioned at the origin.
Actual Behavior:
The specified error message appears, and transformations are not applied as expected.
Me Rambling
Further Musings
In these scenarios, the Vox class is aware of the transforms as well as the groups and is correctly reading them from the vox file. It appears that how it is written there is no support for groups.
I'm unsure if this is intended and considered as being in-scope or if this is something that hasn't been touched on yet. If handling groups is something that is planned for the future, the hardstop if statement in vox.py could be written.
As it is written now, when objects are in groups and when objects have no explicit transform (such as when they're at the origin) the
_transmethod of the Vox class won't combine two models.Possible Tempoary Band-Aid
Temporary band-aid is a gross nested-if to still allow Vox class to at least attempt to combine the models. Though, this will obviously result in the models likely being in the incorrect orientaion or having some other unexpected transforms.
Long-Term Solution
For a sustainable resolution, MidVoxIO would need to integrate comprehensive support for group transformations. This enhancement would entail developing the capability within the Vox class to accurately recognize and process group hierarchies, applying transformations recursively from groups down to their child models. Implementing this feature would not only align MidVoxIO more closely with the .vox format's complexities but also significantly improve its utility for users dealing with advanced modeling scenarios. Such an improvement would mark a significant step forward in making MidVoxIO a more versatile and powerful tool for voxel model manipulation.