Page 1 of 1

Blender script not working

PostPosted: 17 Oct 2013, 03:54
by eliminator
When I try to enable the SuperTuxKart Panel option in Blender it gives me the error:
Image

Re: Blender script not working

PostPosted: 17 Oct 2013, 07:40
by rubberduck
i and some others had this problem too.

i hope that you can find the solution here:

viewtopic.php?f=17&t=4039&p=41587&hilit=panel#p41587

viewtopic.php?f=18&t=4298&p=44297&hilit=panel#p44297

Re: Blender script not working

PostPosted: 17 Oct 2013, 17:45
by eliminator
I looked there, but I couldn't find a solution.

Re: Blender script not working

PostPosted: 17 Oct 2013, 18:53
by eliminator
Can anyone help?

Re: Blender script not working

PostPosted: 17 Oct 2013, 20:33
by rubberduck
have you the stkdata folder in the right place?

where do you have them?

Re: Blender script not working

PostPosted: 17 Oct 2013, 20:39
by eliminator
In C:\Program Files\Blender Foundation\Blender\2.68\scripts\addons I have the stkdata folder and all the .py scripts.

Re: Blender script not working

PostPosted: 18 Oct 2013, 00:38
by Auria
Hi,

this is an error I have never seen before, and the scripts work correctly on my computer. How did you download the scripts? Maybe the XML file is corrupted somehow

Re: Blender script not working

PostPosted: 18 Oct 2013, 03:36
by eliminator
I tried re-downloading it, and just copping it from sourceforge and pasting it, but it still won't work.

Re: Blender script not working

PostPosted: 18 Oct 2013, 04:42
by Auria
I am a bit baffled.

Let's try something. Please install the very latest version of stk_panel.py (I just changed it). Then run blender. Use menu "Window" > "Toggle System console" to make sure the terminal window is visible, then share what is written on it (if there is vertical scrolling please make sure to include all of the output).

It may also help if you could upload here you 'stkdata/stk_panel_parameters.xml' file. What is very weird is that it says there is an error on line 117 of this file - but this file actually contains less than 90 lines

Re: Blender script not working

PostPosted: 18 Oct 2013, 05:02
by eliminator
Here is the console text:
Read new prefs: C:\Documents and Settings\Eliminator\Application Data\Blender Foundat
ion\Blender\2.68\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.68\python
(STK) Loading XML files from C:\Program Files\Blender Foundation\Blender\2.68\s
cripts\addons\stkdata
(STK) Loading scene properties from C:\Program Files\Blender Foundation\Blender
\2.68\scripts\addons\stkdata\stk_panel_parameters.xml
(STK) Loading object properties from C:\Program Files\Blender Foundation\Blende
r\2.68\scripts\addons\stkdata\stk_object_parameters.xml
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender\2.68\scripts\modules\addon_u
tils.py", line 294, in enable
mod = __import__(module_name)
File "C:\Program Files\Blender Foundation\Blender\2.68\scripts\addons\stk_pane
l.py", line 793, in <module>
STK_PER_OBJECT_TRACK_PROPERTIES = getPropertiesFromXML(object_params_path, c
ontextLevel=CONTEXT_OBJECT)
File "C:\Program Files\Blender Foundation\Blender\2.68\scripts\addons\stk_pane
l.py", line 768, in getPropertiesFromXML
node = xml.dom.minidom.parse(filename)
File "C:\Program Files\Blender Foundation\Blender\2.68\python\lib\xml\dom\mini
dom.py", line 1962, in parse
return expatbuilder.parse(file)
File "C:\Program Files\Blender Foundation\Blender\2.68\python\lib\xml\dom\expa
tbuilder.py", line 910, in parse
result = builder.parseFile(fp)
File "C:\Program Files\Blender Foundation\Blender\2.68\python\lib\xml\dom\expa
tbuilder.py", line 205, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: mismatched tag: line 117, column 4



Also here is my stk_panel_parameters.xml: http://pastebin.com/rUh6SWSB

Re: Blender script not working

PostPosted: 18 Oct 2013, 10:36
by rubberduck
a small notice:

i found a error-message that comes close to yours:

viewtopic.php?f=17&t=3042&hilit=panel

but i think you tried the same, i hope that this can help you a bit.

Re: Blender script not working

PostPosted: 18 Oct 2013, 17:40
by eliminator
Yes, I already tried re-downloading the xml a bunch of times.

Re: Blender script not working

PostPosted: 18 Oct 2013, 23:11
by Auria
I am afraid I have absolutely no idea what may be the problem, everything appears to be in order. On my computer with a setting identical to yours, everything works correctly, and many other people have used the scripts without problems. So there has to be something different on your computer, but what? I cannot tell at this time

The error appears to be that 'C:\Program Files\Blender Foundation\Blende
r\2.68\scripts\addons\stkdata\stk_object_parameters.xml' has something invalid at line 117; yet it does not even have that many lines... so what is triggering the problem, I do not know. Perhaps I guess really make sure you are updating the right path (just in case you have another blender installed somewhere else and you were placing the files in the wrong blender)

Re: Blender script not working

PostPosted: 18 Oct 2013, 23:49
by eliminator
I deleted the files and they were gone in blender, so I know the directory is correct.
What version of blender do you have? I am using 2.68a

Re: Blender script not working

PostPosted: 19 Oct 2013, 16:51
by Auria
I am also using 2.68a

Re: Blender script not working

PostPosted: 19 Oct 2013, 21:58
by eliminator
I updated my python, but it sill doesn't work.
I'm stuck.

Re: Blender script not working

PostPosted: 20 Oct 2013, 20:35
by Uni
Perhaps try a linux distribution? (You could create a live image on a USB stick, that way you don't have to mess with partitions, and it's portable. You could also use a virtual machine. You also have wubi, which installs Ubuntu like a windows application, very handy if it's the first time installing an OS. As it guarantees you, that you don't mess up your computer. Or the best option : actually dual booting it. Once you're used to linux, you don't want anything else.) I'm always kinda amazed when Windows is used for open source development.

Re: Blender script not working

PostPosted: 20 Oct 2013, 22:39
by Auria
eliminator, do you know any programming? If yes,maybe you could with some help inspect more closely what is going on

Re: Blender script not working

PostPosted: 21 Oct 2013, 18:34
by eliminator
Uni {l Wrote}:Perhaps try a linux distribution? (You could create a live image on a USB stick, that way you don't have to mess with partitions, and it's portable. You could also use a virtual machine. You also have wubi, which installs Ubuntu like a windows application, very handy if it's the first time installing an OS. As it guarantees you, that you don't mess up your computer. Or the best option : actually dual booting it. Once you're used to linux, you don't want anything else.) I'm always kinda amazed when Windows is used for open source development.

I have Linux on my other computer, but I get the same error.

Auria {l Wrote}:eliminator, do you know any programming? If yes,maybe you could with some help inspect more closely what is going on

I know some code, but not python.

Just as a test can you 7z up your stkdata folder and related .pys and upload them for me to test?

Here is my Linux error:
{l Code}: {l Select All Code}
Traceback (most recent call last):
  File "/usr/lib/blender/scripts/modules/addon_utils.py", line 259, in enable
    mod = __import__(module_name)
  File "/home/eliminator/.blender/2.63/scripts/addons/stk_panel.py", line 785, in <module>
    SCENE_PROPS = getPropertiesFromXML(os.path.join(datapath, "stk_panel_parameters.xml"), contextLevel=CONTEXT_SCENE)
  File "/home/eliminator/.blender/2.63/scripts/addons/stk_panel.py", line 768, in getPropertiesFromXML
    node = xml.dom.minidom.parse(filename)
  File "/usr/lib/python3.2/xml/dom/minidom.py", line 1945, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python3.2/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python3.2/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: mismatched tag: line 117, column 4

Re: Blender script not working

PostPosted: 21 Oct 2013, 23:10
by Auria
I have attached the files

Re: Blender script not working

PostPosted: 22 Oct 2013, 00:07
by eliminator
Astonishingly, it worked...

Re: Blender script not working

PostPosted: 22 Oct 2013, 10:07
by Funto
Hum, then you should try to see the differences between both.
If you are using Windows, I suggest you use the free WinMerge for that to compare the directories. On Linux you have plain GNU diff, or Meld, which is quite good, as a graphical alternative.

Re: Blender script not working

PostPosted: 27 Oct 2013, 22:48
by eliminator
OK, the script is still working, but with this one kart when I try to export it I get this error:

{l Code}: {l Select All Code}
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender\2.68\scripts\addons\stk_kart.py", line 421, in execute    savescene_callback(os.path.dirname(self.filepath))
  File "C:\Program Files\Blender Foundation\Blender\2.68\scripts\addons\stk_kart.py", line 371, in savescene_callback    exporter = exportKart(path)
  File "C:\Program Files\Blender Foundation\Blender\2.68\scripts\addons\stk_kart.py", line 228, in exportKart    split_color[0] = "%.2f" % (int(split_color[0]) / 255.0)ValueError: invalid literal for int() with base 10: '0.7'

location: <unknown location>:-1

location: <unknown location>:-1

Re: Blender script not working

PostPosted: 29 Oct 2013, 01:13
by Auria
Hi,

it would appear that this kart has a malformed color (apparently it contains "0.7", but colors must contain integer numbers ranging from 0 to 255 - for instance a color could be "10 100 213"). I will improve error validation to correctly report the problem