Open rrenode opened 5 months ago
@rrenode Thank you for highlighting this issue! A quick fix will be pushed soon to fix this bug.
As you mentioned, better support for group transformation is needed. The MidVoxIO is a fork of py-vox-io, which is created when the vox file does not support group. Although we added group support subsequently, it was done without a comprehensive overhaul to fully integrate this feature from a holistic standpoint.
Thanks for pointing this out! I will keep this issue open as a reminder.
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
_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.
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.