voxwriter
voxwriter copied to clipboard
Unable to export with a high voxel detail
I just test it and find that its most voxel detail is 126
When I change the code in init file where voxelize(context.active_object, self.filepath, vox_detail=max(0,min(126,self.voxel_detail)), use_default_palette=self.use_default_palette)
from 126 to 1024
I can export to voxel detail of 256 but more than that I will face with a python error says ubyte format requires 0 <= number <= 255
I cannot solve this problem
99% of its job is done. The only problem is on writing converted object to a file
Actually when I enter a number into voxel detail field I have not any restriction. I can enter a number greater than 126. The interesting fact is that when I enter a number greater than 126 the process of exporting and converting will take more time but the final file result is always equivalent to 126 voxel detail 126 voxel detail file = 127 voxel detail file = 10240 voxel detail file There is not any cube ( voxel/ pixel ) that is different in the above examples however we have different voxel detail numbers and the process of exporting takes much more time
error is
Palette length 1
Python: Traceback (most recent call last):
File "/home/abol/.config/blender/3.0/scripts/addons/voxwriter-master/__init__.py", line 45, in execute
voxelize(context.active_object, self.filepath, vox_detail=max(0,min(1024,self.voxel_detail)), use_default_palette=self.use_default_palette)
File "/home/abol/.config/blender/3.0/scripts/addons/voxwriter-master/writer.py", line 236, in voxelize
VoxWriter(file_path, vox).write()
File "/home/abol/.config/blender/3.0/scripts/addons/voxwriter-master/pyvox/writer.py", line 48, in write
chunks.append((b'XYZI', pack('i', len(m.voxels)) + b''.join(pack('BBBB', *v) for v in m.voxels)))
File "/home/abol/.config/blender/3.0/scripts/addons/voxwriter-master/pyvox/writer.py", line 48, in <genexpr>
chunks.append((b'XYZI', pack('i', len(m.voxels)) + b''.join(pack('BBBB', *v) for v in m.voxels)))
struct.error: ubyte format requires 0 <= number <= 255
location: <unknown location>:-1
This is the case that your code is not changed
if I use a voxel detail more than 255 there is not any problem ( ubyte error is not thrown )
- voxel detail = 1024 ==> successful but the file is same as 126 voxel detail
- exported file with voxel detail of 1024 = exported file with voxel detail of 126
This is the case that your code is changed ( change number 126 to 1024 )
Now if I change the voxel detail from 126 to 255 the exported file is different
exported file with voxel detail of 255 != exported file with voxel detail of 126
But if I use a voxel detail more than 255 I will face with ubyte error and the file is not exported however it is processed to 99%
The images for importing final results using Goxel application from your plugin export