supertuxkart / stk-blender Goto Github PK
View Code? Open in Web Editor NEWBlender 2.80 exporter
License: MIT License
Blender 2.80 exporter
License: MIT License
Hello, I was trying to mod my SuperTuxKart v1.2 installation to look like a mix of various old SuperTuxKart versions. When I try to export an old SuperTuxKart v0.7.0 model into an SPM, clicking on File > Export doesn't show it.
Traceback (most recent call last):
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_antarctica_scene\stk_kart.py", line 500, in execute
savescene_callback(self, context, os.path.dirname(self.filepath))
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_antarctica_scene\stk_kart.py", line 448, in savescene_callback
exportKart(self, sPath)
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_antarctica_scene\stk_kart.py", line 417, in exportKart
static_mesh_frame = straight_frame)
File "C:\Users\awab1\OneDrive\Documents\Desktop\SuperTuxKart\blender-2.83.20-windows-x64\2.83\scripts\modules\bpy\ops.py", line 201, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm_init_.py", line 115, in execute
export_spm.writeSPMFile(self.filepath, spm_parameters)
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm\export_spm.py", line 772, in writeSPMFile
export_vcolor, arm_count != 0, need_export_tangent)
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm\export_spm.py", line 376, in writeVertex
tmp_buf += writeHalfFloat(self.m_all_uvs[1])
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm\export_spm.py", line 54, in writeHalfFloat
return struct.pack("<e", float32)
OverflowError: float too large to pack with e format
location: C:\Users\awab1\OneDrive\Documents\Desktop\SuperTuxKart\blender-2.83.20-windows-x64\2.83\scripts\modules\bpy\ops.py:201
location: :-1
bpy.context.space_data.recent_folders_active = 0
Could not find markers left/straight/right in frames 1 to 250, steering animations may not work.
Could not find markers for win/lose animations in frames 1 to 250, win/lose animations may not work.
Traceback (most recent call last):
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_antarctica_scene\stk_kart.py", line 500, in execute
savescene_callback(self, context, os.path.dirname(self.filepath))
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_antarctica_scene\stk_kart.py", line 448, in savescene_callback
exportKart(self, sPath)
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_antarctica_scene\stk_kart.py", line 417, in exportKart
static_mesh_frame = straight_frame)
File "C:\Users\awab1\OneDrive\Documents\Desktop\SuperTuxKart\blender-2.83.20-windows-x64\2.83\scripts\modules\bpy\ops.py", line 201, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm_init_.py", line 115, in execute
export_spm.writeSPMFile(self.filepath, spm_parameters)
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm\export_spm.py", line 772, in writeSPMFile
export_vcolor, arm_count != 0, need_export_tangent)
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm\export_spm.py", line 376, in writeVertex
tmp_buf += writeHalfFloat(self.m_all_uvs[1])
File "C:\Users\awab1\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_scene_spm\export_spm.py", line 54, in writeHalfFloat
return struct.pack("<e", float32)
OverflowError: float too large to pack with e format
location: C:\Users\awab1\OneDrive\Documents\Desktop\SuperTuxKart\blender-2.83.20-windows-x64\2.83\scripts\modules\bpy\ops.py:201
location: :-1
I have installed addons in \AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons
and enabled them.
I have downloaded stk-media-repo from https://supertuxkart.net/Media_Repo and patched them with original STK installation folder, and I can open built models from the STK installation folder.
But if I opened the same file with Blender 2.79, the rendering will be different.
Blender 2.79 can't install the latest addones, and Blender 4.1 with addons cannot open .spm
files even after patching the media repo to the original installation folders.
Should I install specific version of Blender, or use the conversion python script to convert the .spm
files in installation folders?
My working environment:
Blender 4.1
SuperTuxKart 1.4
Windows 11 Home 64-bit (10.0, Build 22631)
13th Gen Intel(R) Core(TM) i5-13500H
Driver Version: 31.0.101.5186
Currently using stk-blender with commit 88ff5df.
Python: Traceback (most recent call last):
File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/__init__.py", line 62, in execute
import_spm.loadSPM(context, **keywords)
File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/import_spm.py", line 260, in loadSPM
material = create_material(tex_fname_1, tex_fname_2, tex_name_1, tex_name_2)
File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/import_spm.py", line 40, in create_material
principled_node.inputs["Specular"].default_value = 0
KeyError: 'bpy_prop_collection[key]: key "Specular" not found'
We may need something like this:
# .distance property in blender 2.8+ is no longer configurable in GUI, we use the "Radius" now
# which is .shadow_soft_size in API
instancing = []
for object in bpy.context.scene.objects:
if object.type=="LIGHT" and object["type"].upper() == "LIGHT" and not object.data.name in instancing:
object.data.energy = object.data.energy / 100.0
object.data.shadow_soft_size = object.data.distance
instancing.append(object.data.name)
"Radius" in blender 2.8x is .object.data.shadow_soft_size, so we need to use it instead of .distance
Due to the deprecation of object proxies in favor of "library overrides" starting in blender 3+, exporting fails with error "Attribute Error: obj has no attribute proxy."
Would you mind uploading a up to date blender exporter for STK to blender extensions when it's launched?
This would be interesting for contributors for STK.
It will be seen by thousands of Blender users!
https://code.blender.org/2022/10/blender-extensions-platform/
I believe there is a bug (or at least a bad programming design) in how the Activate field is filled out by its pull-down (for checkline, runline, and lapline objects). The Activate field is meant to be filled out with a checkline group name. The pull-down displays a list of Blender Object names of all checkline objects, along with their checkline group names.
The problem is that clicking an option in this list does not fill out the Activate field with a object's checkline group name, but rather the option's Blender Object name. If the Blender Object name of a checkline object is not the same as its checkline group name, this results in track faliure. In the case of a track with multiple routes, parallel checkline objects (that is, checkline objects that are part of the same group because they are on different routes) must have different Blender Object names than eachother (because Blender objects cannot have the same Blender Object name), and thus only one such parallel checkline object can have the same Blender Object name as its checkline group name.
While this flaw does not ultimately prevent the addon (or even the drop-down) from functioning at all, it does place an unnecessary burden on the user, if they use the drop-down picker, to make sure they always make the Blender Object name of checkline objects to be the same as their checkline groups, and when multiple routes make this impossible, to always pick only the object in a checkline group with the same Blender Object name as its checkline group. A better design would be to have the drop-down fill out the Activate field with, not the object's Blender Object name, but rather the name of the checkline group it is a part of, since this is the data that the Activate field is meant to be filled out with, and not something that may or may not be synonymous with the name of the checkline group.
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.