:egg2pg(error) but egg exist

Hi, i have a strange trouble now.
I’m trying to load a model with a DirectOptionMenu(), and it works fine except for some models.
So i put an exception to launch pview, to check if the model is readable, and it is …

Here is the code :

try:     
	exec("self.parent.%s = loader.loadModel(\"%s\")" %(name,model))
except : 
	try: os.system("start C:\\Panda3D-1.5.4\\bin\\pview.exe "+model)
	except : print model+" can not be loaded"

and the error is :
[b]Error in /f/NavAllUdp/Viewer/models/Model/sonicube06.egg at line 0, column 10:
{ 0 1 20.5texRef> { . <Veigp
^
parse error

:egg2pg(error): Error reading /f/NavAllUdp/Viewer/models/Model/sonicube06.egg
:loader(error): Couldn’t load file models/Model/sonicube06.egg: all matching files on model path invalid (the model path is currently: “/f/NavAllUdp/Viewer;/c/Panda3D-1.5.4/etc/…;/c/Panda3D-1.5.4/etc/…/models”)[/b]

after this, the command “pview models/Model/sonicube06.egg” show correctly this model without any error nor warning …
Of course, the string “20.5texRef” cant not be find in sonicube06.egg

This is very strange for me, therefore, i can’t exactly reproduce this error, some time the model is loading, sometime not.

I get the same error under linux …

Do someone have an idea ?

Regards

Hi again, it looks like the problem can be solve under linux :

os.system("iconv -f UTF-8 -t ISO-8859-1 "+localPath+" -o "+localPath+".tmp")

Ok, some of my french models may have terrible caracters in their group’s name …

Interesting, isn’t it ?

Sounds like you have a model converter that generated an invalid egg file. Which converter did you use?

David

Some of the models came from maya, others from 3ds, other were generated by scripts …
I think that i would have notice if only maya or max exporter went wrong…
Maybe because those models was coming from france/usa on mac/linux/win …

But the fact is that before the “iconv”, sometime a model was loaded, and sometime not !!!

Maybe Panda is getting the first file format, and dont accept others ?

I don’t think the egg syntax is defined to be international-character-safe. It’s defined on the ASCII character set only. So if there are international characters in some of your group names, it is technically an invalid egg file.

It may be that iconv helps by replacing utf-8 characters with iso8859 characters. But it’s still technically an invalid egg file if it’s not strictly ASCII. Any converter that writes international characters into the egg file is technically violating syntax.

David