STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
361
IN-GAME
2,139
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
Vanvidd 13 Feb, 2018 @ 10:25am
smd converter
Please, help. I need to convert a lot of .smd files to fbx, I use this script in the console:

import bpy
import os

for root, dirs, files in os.walk('d:\Sourcemodels\smd'):
for name in files:
if name.endswith('smd'):
# delete everything
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
# adjust this to match the import smd operator
bpy.ops.import_scene.smd(filepath=os.path.join(root, name))
#Transform and save
k = 0.027 #scale constant
bpy.ops.transform.resize(value=(k,k,k))
bpy.ops.object.transform_apply(scale=True)
# export as fbx
bpy.ops.export_scene.fbx(filepath=os.path.join(root, name+'.fbx'))

but get this:


{'FINISHED'}
{'FINISHED'}
Error: Traceback (most recent call last):
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\addons\io_scene_valvesource\import_smd.py", line 73, in execute
self.num_files_imported = self.readSMD(filepath, self.properties.upAxis, self.properties.rotMode)
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\addons\io_scene_valvesource\import_smd.py", line 1267, in readSMD
print("\nSMD IMPORTER: now working on",smd.jobName)
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\addons\io_scene_valvesource\utils.py", line 90, in print
builtins.print(" ".join([str(a) for a in args]).encode(sys.getdefaultencoding()).decode(sys.stdout.encoding), end= "\n" if newline else "", flush=True)
TypeError: decode() argument 1 must be str, not None

location: D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\modules\bpy\ops.py:189


Traceback (most recent call last):
File "<blender_console>", line 8, in <module>
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\modules\bpy\ops.py", line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\addons\io_scene_valvesource\import_smd.py", line 73, in execute
self.num_files_imported = self.readSMD(filepath, self.properties.upAxis, self.properties.rotMode)
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\addons\io_scene_valvesource\import_smd.py", line 1267, in readSMD
print("\nSMD IMPORTER: now working on",smd.jobName)
File "D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\addons\io_scene_valvesource\utils.py", line 90, in print
builtins.print(" ".join([str(a) for a in args]).encode(sys.getdefaultencoding()).decode(sys.stdout.encoding), end= "\n" if newline else "", flush=True)
TypeError: decode() argument 1 must be str, not None

location: D:\Program Files (x86)\Steam\steamapps\common\Blender\2.79\scripts\modules\bpy\ops.py:189


How to fix it?
< >
Showing 1-3 of 3 comments
xdshot 13 Feb, 2018 @ 11:06am 
Try Noesis
Vanvidd 13 Feb, 2018 @ 11:19am 
Originally posted by xDShot™:
Try Noesis
It works, thank you.
Artfunkel 13 Feb, 2018 @ 11:50am 
The error you're seeing is fixed if you get the latest source from GitHub[github.com]. I really need to ship a new version!
< >
Showing 1-3 of 3 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: 13 Feb, 2018 @ 10:25am
Posts: 3