KatsBits Community

Game Editing => 3D Modeling & Content Creation => Topic started by: bookentire on February 10, 2011, 09:53:07 PM

Title: [md3] Import error
Post by: bookentire on February 10, 2011, 09:53:07 PM
administrator kat,
please help. i am new to blender and am having difficulty importing my first mesh.
Code: [Select]
Compiled with Python 2.6.2.
Checking for installed Python... got it!
Traceback (most recent call last):
File "(string)", line 1, in (module)
File "C:\Program Files (x86)\Blender\.blender\scripts\io\md3_import.py", line 45, in (module)
import md3
ImportError: No module named md3
Title: Re: [md3] Import error
Post by: kat on February 11, 2011, 08:28:40 AM
Will need a bit more information on this.. What version of Blender and the MD3 scripts are you using? There are a couple out in the wilds. Also what's the model you're trying to import? You basically need to post more background details/explanation in terms of what you're trying to do to be able to properly answer you on this one.

Split this into it's own topic by the way, because it's about MD3 rather than ASE where you originally posted  ;)
Title: Re: [md3] Import error
Post by: bookentire on February 11, 2011, 02:34:26 PM
TY for your reply,
i am using Blender 2.49b.
the scripts were acquired from: http://www.katsbits.com/files/md3/blender-md3.zip.
where is the version number on these scripts?
the ImportError happens immediately after selecting the Import\Quake3 (md3), Before selecting any model.

apologies for first posting this request in ASE.
Title: Re: [md3] Import error
Post by: kat on February 11, 2011, 04:24:44 PM
That's probably going to be a compatibility problem, the MD3 script was written for older versions of Blender 2.42, 2.43 or 2.45, you'll need to try loading those (plus the appropriate version of Python). Oh and... open the script into a text editor and you'll see the details at the top of the file.
Title: Re: [md3] Import error
Post by: bookentire on February 11, 2011, 10:49:06 PM
kat,
i am now using Blender 2.43 with Python 2.4.msi.
the three MD3 files were placed in folder Blender Foundation\Blender\.blender\scripts\io.
the md3.py says it is: MD3_VERSION 15
do the md3_export.py and md3_import.py have version numbers also?

when selecting the Import\Quake3 (md3), Python now tells me this:
Code: [Select]
Compiled with Python version 2.4.
Checking for installed Python... got it!
Traceback (most recent call last):
File "(string)", line 45, in ?
ImportError: No module named md3
Title: Re: [md3] Import error
Post by: kat on February 12, 2011, 06:28:11 AM
Hmm.. I just double checked the MD3 files, you'll need to try this using Blender 2.42 (and the appropriate python install) which is what that version of the script was originally written for. BTW, you can install multiple Blender/Python combinations so long as each is in it's own directory.
Title: Re: [md3] Import error
Post by: bookentire on February 12, 2011, 08:36:11 PM
kat,
now i am using Blender 2.42.
this Blender does not have the same directory structure, So i made one: "Blender Foundation\Blender\.blender\scripts\io".
And placed the three MD3 files inside folder \io.
have i been placing the scripts in the wrong location all along?

when selecting the Import\Quake3 (md3), Python tells me this:
Code: [Select]
Compiled with Python version 2.4.
Checking for installed Python... got it!
Traceback (most recent call last):
File "(string)", line 45, in ?
ImportError: No module named md3
Title: Re: [md3] Import error
Post by: kat on February 12, 2011, 08:59:00 PM
Yes that won't work, you can't 'invent' directory structures like that. Blenders script directory locations are explained here (http://www.katsbits.com/tutorials/blender/useful-keyboard-shortcuts.php#scripts).

The easiest thing to try first is to load the script into the Text Editor and run it from there. Switch the main 3D view to the Text Editor (Shift+F11) and the "Open" the script by clicking the double headed arrow button (in between the "AB" and "Screen 12" buttons) then use Alt+P to run it and go through the import process.
Title: Re: [md3] Import error
Post by: bookentire on February 12, 2011, 10:08:23 PM
kat,
the three MD3 scripts have been placed in "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\".

after using Blender to open the file "md3_import.py", And using ALT+P to run, Python says this:
Code: [Select]
Compiled with Python version 2.4.
Checking for installed Python... got it!
Traceback (most recent call last):
File "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\md3_import.py", line 45, in?
import md3
File "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\md3.py", line 7, in?
import q_shared
ImportError: No module named q_shared
Title: Re: [md3] Import error
Post by: kat on February 13, 2011, 06:33:48 AM
Have you got your Python Path Variable set (http://www.katsbits.com/tutorials/blender/setting-up-windows-python-path-system-variable.php)?
Title: Re: [md3] Import error
Post by: bookentire on February 13, 2011, 03:42:02 PM
kat,
i have now set the variable:
"PYTHONPATH"
"C:\PYTHON24;C:\PYTHON24\DLLs;C:\PYTHON24\LIB;C:\PYTHON24\LIB\LIB-TK"
but am getting the same error.
Title: Re: [md3] Import error
Post by: kat on February 13, 2011, 06:10:08 PM
OK.. had to do a bit of checking on this one. Download the zip file again (use the link you posted above) and follow the instructions and place all the files in Blenders "scripts" folder (except the "readme.txt", that's not needed). Once you do that "File >> Import >> Quake 3 (.md3)" and "File >> Export >> Quake 3 (.md3)" should appear in the main File menu, just select "import" and browse to the file, select and follow the directions.

I tested this on my Kubelwagon MD3 and it imported OK; the mesh is untextured but the material paths *do* import, you just need to reassociate images and relative paths.

(https://www.katsbits.com/images/tools_utilities/blender-md3-import-export-script_lrg.jpg)
Title: Re: [md3] Import error
Post by: bookentire on February 14, 2011, 12:21:59 AM
kat,
Blender 2.42 does not have this directory structure:
[drive]:\Program Files\Blender Foundation\Blender\.blender\scripts
instead the scripts folder is placed in:
C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\

when i placed your new files in this scripts folder and tried to import, Python gives me this:
Code: [Select]
Compiled with Python version 2.4.
Checking for installed Python... got it!
INFO Starting ...
INFO Importing MD3 model: C:\Documents and Settings\Administrator\Desktop\Projects\bird001.MD3
INFO Shader path name:  C:/Documents and Settings/Administrator/Desktop/Projects/bird001/
INFO Model name: bird001
Traceback (most recent call last):
File "(string)", line 405, in FileSelectorCallback
File "(string)", line 189, in Import
File "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\md3.py", line 593, in Load
self.surfaces[i].Load(file, log)
File "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\md3.py", line 304, in Load
self.shaders[i].Load(file)
File "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\md3.py", line 201, in Load
self.name = asciiz(data[0])
File "C:\Documents and Settings\Administrator\Application Data\Blender Foundation\Blender\.blender\scripts\q_shared.py", line 29, in asciiz
while(ord(s[n]) !=0):
IndexError: string index out of range
Title: Re: [md3] Import error
Post by: kat on February 14, 2011, 06:40:59 AM
Where have you got Blender installed to exactly? Try re-installing (after removal) and of the three option you have for "Specify User data Location" during set up (third or so screen in iirc), choose the second one ("Use Installation Direcory (ie. location chosen to install blender.exe)"). Once that's done try the scripts again (as per above).
Title: Re: [md3] Import error
Post by: bookentire on February 14, 2011, 09:49:29 AM
kat,
after completing a full uninstall, The Blender 2.42 installer 'Choose Install Location' page will by default create the destination folder: "C:\Program Files (x86)\Blender Foundation\Blender"

on the 'Specify User Data Location' page, the second option: "Use Installation Directory (ie. location chosen to install blender.exe)" by default is selected.

installing this way has set up the scripts folder inside the installed directory, But Python is now giving me this slightly different error message.

Code: [Select]
Compiled with Python version 2.4.
Checking for installed Python... got it!
INFO Starting ...
INFO Importing MD3 model: C:\Documents and Settings\Administrator\Desktop\Projects\bird001.MD3
INFO Shader path name:  C:/Documents and Settings/Administrator/Desktop/Projects/bird001/
INFO Model name: bird001
Traceback (most recent call last):
File "(string)", line 405, in FileSelectorCallback
File "(string)", line 189, in Import
File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\md3.py", line 593, in Load
self.surfaces[i].Load(file, log)
File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\md3.py", line 304, in Load
self.shaders[i].Load(file)
File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\md3.py", line 201, in Load
self.name = asciiz(data[0])
File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\q_shared.py", line 29, in asciiz
while(ord(s[n]) !=0):
IndexError: string index out of range

Title: Re: [md3] Import error
Post by: kat on February 14, 2011, 11:55:13 AM
Just tried this on another PC that's got XP Pro loaded and it worked (originally worked on Vista). However, both are 32bit systems and not the 64bit you appear to be running? If so, that's likely the problem. Try manually installing the files to "Program Files" instead of "Program Files (x86)" to see if that makes any difference (I can't remember if Windows does some auto-config when it reads "(x86)" in the file name on 64bit systems). Failing that you're going to need to find a way to run Blender in 32bit mode. I don't know how you'd do that I'm afraid (unless there's a 'properties' setting that can be used - right-click the exe and select "Properties").
Title: Re: [md3] Import error
Post by: bookentire on February 19, 2011, 05:25:48 PM
kat,
thank you very much for your efforts.
Title: Re: [md3] Import error
Post by: tea monster on May 08, 2011, 02:00:20 PM
Have you guys tested either this: http://cube.wikispaces.com/MD3+Export+From+Blender+Tutorial (http://cube.wikispaces.com/MD3+Export+From+Blender+Tutorial) exporter or the one that Plagman has issued with the Duke HRP project?
Title: Re: [md3] Import error
Post by: kat on May 08, 2011, 03:39:51 PM
I think the Sauerbraten scripts are the same/similar, looks like they're for 2.4(n) releases of Blender.