Page 2 of 4

Re: Import errors

PostPosted: Tue Mar 18, 2008 2:26 pm
by Nadnerb
Your import tweaks have been reviewed and merged.

Re: Import errors

PostPosted: Tue Mar 18, 2008 2:35 pm
by Robert The Rebuilder
Thanks, Nadnerb!

Re: Import errors

PostPosted: Thu Mar 20, 2008 7:57 am
by andylegate
Just tried to import with the cutting edge plugin, and with Cyan Ages I'm still getting errors. Here is the most common one:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 145, in open_file
  File "<string>", line 90, in import_age
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcresmanag
er.py", line 195, in import_all
    self.load()
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcresmanag
er.py", line 126, in load
    self.prp.read(f)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcprpfile.
py", line 583, in read
    obj.read(buf)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcprpfile.
py", line 381, in read
    o.read(buf,offset,size)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcprpfile.
py", line 290, in read
    self.data.read(buf)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alc_MatClas
ses.py", line 2497, in read
    plLayerAnimationBase.read(self, stream)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alc_MatClas
ses.py", line 2470, in read
    self.fOpacityCtl.read(stream)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alc_AnimCla
sses.py", line 531, in read
    self.data.read(buf)
AttributeError: plPosController instance has no attribute 'read'

Re: Import errors

PostPosted: Thu Mar 20, 2008 9:06 am
by Robert The Rebuilder
Which age was it, Andy?

Re: Import errors

PostPosted: Thu Mar 20, 2008 10:57 am
by andylegate
Ahnonay Sphere 1, and Relto. Either one. I've imported Relto before, back with the 0.5 plugin version.

But just about any Age now.

Re: Import errors

PostPosted: Fri Mar 21, 2008 6:59 am
by Robert The Rebuilder
I found the problem. The various plController classes have not all been implemented yet, which is related to the recent addition of the plLayerAnimation class. So, until this is finished, I put in a try-except block in plLayerAnimation.read() similar to plResponderModifier.read() - if an error occurs, it skips reading in the rest of plLayerAnimation and goes on to the next class.

This, of course, revealed another problem. hsGMaterial.ToBlenderMat() expects the layer to have fPreshadeColor and the other plLayerInterface attributes. However, it encounters a plLayerSDLAnimation (which is not implemented yet) and it throws an exception because the data element is actually a pRaw, which does not have these attributes. To fix that, I added a check in ToBlenderMat() to see if the data's object type is not a plLayerSDLAnimation before proceeding. This required pRaw to have its object type set upon creation, so I pass that in to pRaw's constructor in PrpObject.__init__().

Forgive the in-depth explanation; this is really for the benefit of the PyPRP developers so they understand what my fixes entailed.

I checked in the fixes to the contrib folder; you can get them here:
Would someone please check these into trunk for me? Once these are in, you can import Ahnonay Sphere 1 and Relto.

Re: Import errors

PostPosted: Fri Mar 21, 2008 7:33 am
by andylegate
Actually, I sort of understand what you're talking about. It's impossible for me to use something and not start understanding what is going on behind the scenes. That's the engineer in me I'm afraid.

Re: Import errors

PostPosted: Sat Mar 22, 2008 12:17 pm
by andylegate
Oh yah, PS.....It works great now! It even shows the multiple layers of texture, UV Mapping and Vertex Coloring on each mesh now. Great job! :D

Re: Import errors

PostPosted: Sat Mar 22, 2008 7:43 pm
by Robert The Rebuilder
That's great news, Andy!

Again: could someone please review these and check them into trunk?

Robert The Rebuilder wrote:I checked in the fixes to the contrib folder; you can get them here:


[EDIT: Thanks for checking in the fixes, Paradox!]

Re: Import errors

PostPosted: Tue Mar 25, 2008 8:37 am
by Frits
When I try to import the Spyroom.age I get an error and importing stops.
The last line in the console;
ValueError: list must have from 1 up tp 16 materials.

Regards,
Frits