spyduck / voxwriter Goto Github PK
View Code? Open in Web Editor NEWBlender addon to export to the MagicaVoxel .vox format
License: GNU General Public License v3.0
Blender addon to export to the MagicaVoxel .vox format
License: GNU General Public License v3.0
I'm trying to export some of my large objects as vox without needing to split it up and no matter what I set as the resolution it never goes past it. Is there a way around this?
Hi,
After installing the plugin and try to do an export i receive the following error:
Traceback (most recent call last):
File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\voxwriter\__init__.py", line 61, in execute
voxelize(context.active_object, self.filepath, vox_detail=max(0,min(126,self.voxel_detail)), use_default_palette=self.use_default_palette)
File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\voxwriter\writer.py", line 169, in voxelize
source_name = obj.name
AttributeError: 'NoneType' object has no attribute 'name'
location: <unknown location>:-1
I am using Blender v.2.83.5 on Windows 10.
Thanks
If I export as VOX using default palette everything works, but that palette is not ideal.
However, if I turn off default palette, export, then load in MagicaVoxel it does not load the custom palette. Does anyone know how to load the new palette with the .VOX file?
According to the Blender addon guidelines, addons must comply with PEP8 in order to be approved for distribution with Blender. Since this addon could potentially be useful for a lot of people, I think it would be good to comply with the standards, in case it reaches a level of maturity at which it could be submitted for approval.
I ran the flake8 analysis on the code, and it found many issues, mostly related to whitespace. Fixing these issues would require changes to the entire code base.
I would like to know if such changes are acceptable or if there is a particular reason why the code was formatted this way. If there is no problem, I could make the necessary changes and submit a pull request.
I've installed plenty of addons ranging from left to right, normally I find out the issue. I followed the directions with administrative permissions set on and off with blender and the installation still doesn't work, I am using blender 2.83. I love this Idea, It would help me both with my own work and tutorials in which I am hoping to create in regards to voxel modeling from blender to magica. Ty
when I open it with notepad it says this
VOX – MAIN `$ PACK� � SIZE XYZI�$ � ��� ��� �� ��
��� ��� ��� ��� ��� ��
��� �� ��
��� ��� ��� ��� ��� ��� �� ��
��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� ��� ��
��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� ��
��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� ��
��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� ��
��
�
�
��
��
��
��
��
��
��
��
�� � �
�� �� �� �
��� ��� ��� ��� ��� ��
��
��
��
��
��
�� �� �� �� �� ��� ��� ��� ��� ��� ��� ��� ��� ��� ������ ���
���������������
������� ���
��������������������������� ���
������������������������������� ���
������� ���
��������������������������������������������������� ���
������� ���
����������������������������������������������� ���
������� ���
������������������������������������������� ���
���
����������������������������������� �
�
�
���
� �
�
�
���
���
���
���
���
���
���
���
���
� � �
� ��� � � �
� ��� ��� ��� ��� ��� ��� ��� ��� ��� �
������� ���
�������������������������������������
� �
�
�
���
���
���
���
���
���
���
��� ��� ��� ��� �
�����������������������
�����������������������
�����������������������
�����������������������
�����������������������
����������������������� ���
���������������������������
������������������������� ��� � �������
������� ���
������������������� ���
������� ���
��������������������������������������� ���
������� ���
��������������������������������������������������������������� ���
������� ���
������������������������������������������������������������������� ��������������������������������������� �������������������������������������
���
� �
�
�
���
���
���
���
���
���
��� � � �
� ��� �
� ��� ��� ��� ��� ��� ��� ��� ����� ���
������� ���
�����������������������������������
�
���
� �
�
�
���
���
���
���
� � �
� ��� ��� �
�������
������� ���
����������� ���
����������� ���
����������� ������� ���
��������������������������� ���
��������������������������� � �
� ��� ��� ��� ��� ��� ��� ����� ���
��������������� ���
������� ���
����������������������������������������������� ���
������� ���
����������������������������������������������������������� ���
���
����������������������������������������������� �������������������������������������
���
���
� �
���
���
���
���
��� ��� � � ��� ��� ��� ��������� ���
�����������������������������
� �
�
�
���
� �
���
���
���
���
���
�
� ��� � � �
� ��� ��� ��� ��� �
������� ���
����������� ������� ������� ����������� ��������������� ��������������� ������������� � � �
� ��� ��� ��� ��� ��� ��� ��� ���������
�����������������������
������� ���
��������������������������������������� ���
������� ���
���������������������������������������������������������������������
���
��� ��� ��� ��� ��� ��� ��������� ��������������� �
�
�
���
� �
���
���
���
���
��� � � �
� ��� ��� ��� � ���
����������� ���
����������� ������� ������� ������� ������� ����������� ��������������������� � � �
� ��� ��� ��� ��� ��� ��� ��� ��������� ���
���������������������������
������� ���
�����������������������������������
������� ���
����������������������� ���
����������������������� �������������������������������������������������
���
���
���
��� ��� ��� ��� ����� ����������� �
�
�
���
���
���
���
��� � � ��� ��� � ���
�����������
�������
������� ���
��������������������������� ���
��������������������������� ���
��������������������������� ���
��������������������������� ���
��������������������������� � �
� ��� ��� ��� ��� ��� ��� �����������������
������� ���
�����������������������������������
������� ���
��������������������������� ���
������� ������������������� ���
������������������� ����������������������� �����������������������������������������
���
��� ��� ��������� �����������������
� �
�
�
���
���
���
���
���
�
� ��� � � ��� ��� ��� � ���
�����������
�������
�����������������������
��������������������������������������������������������������� ���
���������������������������
������� ���
����������������������������������� ���
����������� ����������� ���������������������������������������������������������������������
���
��� ��� ��� ��� �������������������
� �
�
�
���
���
���
�
� ��� ��� ��� ����� ����������� ���
�����������
�������������������������������
������� ���
����������������������������������� ���
������� ���
����������������������� ��������������� ���������������������������������������������������������������������������������
���
��� ��� �������������������
���
� �
�
�
���
���
���
���
� � �
� ��� ��� ��� ��� ����� ����������� ���
�������������������
�����������������������
��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� �� ��
��� ��� ��� ��� ��� �� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ���
��
�� �� �� ��� ���
��
�
�
��
��
��
��
� �
�� �� �� �� �� �� ��� ��� �� ��
��� ��� ��� ��� ��
��� ��� ��� ��� ��� ���
���
���
���
��
���
��
��
���
���
���
���
���
���
���
���
��
��
���
���
���
��
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
��
��
��
��
��
��
���
���
��
�
��
��
��
�
�
��
��
��
��
��
��
���
���
��
��
���
���
���
���
��
���
���
���
���
���
������������������
������� ���
����������������������������������� ���
��������������� �������������������������������������������������������������������������������������
���
��� ��� ���������������������������
���
���
���
� �
���
���
���
���
���
��� ��� ��� � � �
� ��� ��� ��� ��� ��� ��� ��� ����� ����������� ���
�������������������������������������������
��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� �� ��
��� ��� ��� ��� ��� �� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ���
��
�� �� �� �� �� ��� ��� ��� ��� ��� ��� ��� ���
��
��
��
��
�
��
��
��
��
��
��
�� �� �� �� � �
�� �� �� �� �� �� �� �� �� �� ��� ��� �� ��
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��
���
��
��
���
���
���
���
���
���
���
���
��
��
���
��
��
���
���
���
���
���
���
��
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
��
��
��
��
��
��
��
��
��
��
��
��
��
��
���
���
���
���
���
���
���
���
���
���
��
��
��
��
��
�
�
��
��
��
��
��
��
��
��
��
��
��
��
�
�
��
��
��
��
��
��
��
��
��
��
��
���
���
���
��
��
���
���
���
���
���
���
���
���
������ ���
������������������������������� ���
������� ���
����������������������������������� ���
������������������������������������������������������������������������������������������������������� ��������������������������������������������������������������� ��������������������������������������������������������������� ������������������������������������������������������� �
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
� � ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��������������������������������� ���
���������������������������������������������
���
���
���
���
���
���
� �
�
�
���
���
���
���
���
���
���
���
���
���
���
��� ��� � � ��� ��� ��� ����� ���
�����������������������
�����������������������
��������������������������� ���
������������������������������� ���
������� ���
��������������������������� ���
������������������������������� ������������������������������������������������������� ��������������������������������������������������������������� ��������������������������������������������������������������� ����������������������������������������������������������������������� �
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
� � ��� ��� ��� ��� ��� ��� ��� � � ��� ��� ��� ��� ��� ��� ��� ��� ��� � ��������������������������� ���
�����������������������������������������
���
���
���
�
�
���
���
���
���
���
���
���
��� � � �
� ��� ��� ��� � ���
�������������������������������������������
��������������������������� ���
������������������������������� ���
������� ���
��������������������������� ���
������������������������������� ��������������� ������������������� ��������������������������� ������������������� ��������������������������� ��������������� ����������������������� �
���
���
���
���
� �
�
�
���
���
���
���
���
���
���
� � ��� ��� ��� � � �
� ��� ��� ��� ��� ��� ��� � ��������������� ���
�������������������������������������
���
� �
�
�
���
���
���
���
��� � � �
� ��� ��� ��� ��� ��� ��� ��� �
����������������������������������������������� ���
���������������������������
������� ���
������������������� ���
������� ������������������� ���
��������������� ���
����������������������� ���
�������������������
�
���
� �
���
���
���
�
� ��� � � ��� ��� ��� ����� ���
��������������� �
�
�
���
���
���
���
���
���
�
� ��� ��� ��� ��� ��� ��������������������������������� ���
������������������������������� ���
���������������
������� ���
�������������������
������� ���
����������������������� ���
�����������������
� �
�
�
���
���
���
���
���
� � �
� ��� ��� ��� ��� �
�������������������������
���
���
���
��� ��� ����������������� ���
��������������������������� ���
��������������������������� ���
���������������������������
�����������������������
�
���
���
���
���
���
��� ��� ��� ��� �����������������RGBA� ÌÌÌÿ
blender shows the following error: Python: Traceback (most recent call last):
File "C:\Users\27296\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\voxwriter_init_.py", line 59, in execute
from .writer import voxelize
File "C:\Users\27296\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\voxwriter\writer.py", line 7, in
from pyvox.models import Vox, Color, get_default_palette
ModuleNotFoundError: No module named 'pyvox'
Specs: Max OSX Catalina
error message:
RuntimeError: Operator bpy.ops.object.convert.poll() failed, context is incorrect
StackTrace:
Converting to vox
Python: Traceback (most recent call last):
File "/Users/aliow/Library/Application Support/Blender/3.0/scripts/addons/voxwriter/init.py", line 61, in execute
voxelize(context.active_object, self.filepath, vox_detail=max(0,min(126,self.voxel_detail)), use_default_palette=self.use_default_palette)
File "/Users/aliow/Library/Application Support/Blender/3.0/scripts/addons/voxwriter/writer.py", line 177, in voxelize
bpy.ops.object.convert(target='MESH')
File "/Applications/Blender.app/Contents/Resources/3.0/scripts/modules/bpy/ops.py", line 132, in call
ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.convert.poll() failed, context is incorrect
Blender Error
Python: Traceback (most recent call last):
File "C:\Users\Gebruiker\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\voxwriter_init_.py", line 61, in execute
voxelize(context.active_object, self.filepath, vox_detail=max(0,min(126,self.voxel_detail)), use_default_palette=self.use_default_palette)
File "C:\Users\Gebruiker\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\voxwriter\writer.py", line 223, in voxelize
color = get_color_from_geometry(target, location, normal, orig_scene=orig_scene, location=inside_location, polygon_index=inside_face)
File "C:\Users\Gebruiker\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\voxwriter\writer.py", line 61, in get_color_from_geometry
round((uv[0] % 1.0) * width-1),
ValueError: cannot convert float NaN to integer
location: :-1
Somebody can help me, plz ?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.