Page 1 of 4

Import errors

PostPosted: Thu Mar 13, 2008 5:42 am
by Robert The Rebuilder
Is anyone working on the various import errors? Here are the ones I've discovered so far:

- plLayerAnimation.read() encounters a NoneType for self.fTimeConvert

- plAnimTimeConvert has no getVersion()

- plAnimTimeConvert.read() needs to attempt to read the messages that are implemented to date (see plCameraModifier1.read() for an example)

- plLayerAnimation has no ToBlenderMTex() method

- plCameraBrain1_FirstPerson.read() claims that it has no attribute fOffset because plCameraBrain1_FirstPerson.__init__ needs to call plCameraBrain1_Avatar.__init___(), not plCameraBrain1._init__()

- Imported visual objects do not appear in the blender scene - only physical objects

I'll offer to help; I just don't want to do duplicate work.

Re: Import errors

PostPosted: Thu Mar 13, 2008 6:38 am
by andylegate
Yay! Glad to see it wasn't just me that could not import most Ages anymore.

Re: Import errors

PostPosted: Thu Mar 13, 2008 10:15 am
by Nadnerb
At the moment, I believe that the focus of those actively developing the plugin features is on successful exports, so you're certainly welcome to fix up the import problems, especially if they're entirely preventing successful imports. :)

Re: Import errors

PostPosted: Thu Mar 13, 2008 12:35 pm
by Robert The Rebuilder
OK - I have the fixes. I checked them into contrib/RTR; the files are
Here are the specific fixes I did:

Robert The Rebuilder wrote:- plLayerAnimation.read() encounters a NoneType for self.fTimeConvert

I added a check for None then assign it an instance of plAnimTimeConvert.
Robert The Rebuilder wrote:- plAnimTimeConvert has no getVersion()

I added a getVersion method and a version variable, as well as a default version constructor argument.
Robert The Rebuilder wrote:- plAnimTimeConvert.read() needs to attempt to read the messages that are implemented to date (see plCameraModifier1.read() for an example)

I borrowed code from plCameraModifier1.read() for reading in the messages, surrounded by a try/except that traps any errors in reading and throws an exception to abort the input (with an appropriate error message). This is necessary until we have all the possible message classes implemented.
Robert The Rebuilder wrote:- plLayerAnimation has no ToBlenderMTex() method

Added a stub method. Since plLayer.ToBlenderMTex() sets mtex.colfac and mtex.neg according to the layer's opacity and blend flags, it didn't seem to apply to a layer animation. So, this stub method does nothing except keeping the import going to the finish.
Robert The Rebuilder wrote:- plCameraBrain1_FirstPerson.read() claims that it has no attribute fOffset because plCameraBrain1_FirstPerson.__init__ needs to call plCameraBrain1_Avatar.__init___(), not plCameraBrain1._init__()

Made that fix.
Robert The Rebuilder wrote:- Imported visual objects do not appear in the blender scene - only physical objects


This is not true; the visual objects do appear in a blender scene named after the page; however, physical objects are placed in the default scene. I didn't address that bug in these fixes.

Could someone review these and check them into trunk for me, please?

Re: Import errors

PostPosted: Thu Mar 13, 2008 4:58 pm
by Chacal
Don't forget these errors that D'Lanor found:
Yes, alc_MatClasses and alc_AnimClasses are importing each other.

And alc_MatClasses is importing alc_AnimClasses in two different ways. I guess this needs some code cleaning.


From this thread.

Re: Import errors

PostPosted: Sat Mar 15, 2008 10:36 am
by Goofy
So I'm right in thinking that the importing part of the plugin is more or less being ignored atm? Reason I'm thinking this is as each newer plugin comes there seems to be more and more import problems.

The plugin I have which I believe is 1.2.0 will not import certain ages. I tried to import the neighborhood and got errors and nothing happened. I then tried to import neighborhood02 and it worked with no errors. Also I tried to import the relto and got major errors. Heres the error from importing relto(personal age)

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 576, in read
    obj.read(buf)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcprpfile.
py", line 374, in read
    o.read(buf,offset,size)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcprpfile.
py", line 280, in read
    self.data.read(buf,size)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alc_CamClas
ses.py", line 173, in read
    Msg = PrpMessage.FromStream(stream)
NameError: global name 'PrpMessage' is not defined

I was thinking about what I believe grogyan did to the relto and wanted to import the relto to add a change and got the above error while importing it. was thinking of adding a new relto page. ;)

Re: Import errors

PostPosted: Sat Mar 15, 2008 11:28 am
by D'Lanor
The last plugin version that could do proper imports was the 0.5 stable version. During import everything was also extracted as raw objects. This ensured that objects the plugin could not handle would not get lost. During export the plugin would reassemble the prp file from the raw objects.

Unfortunately this feature has been removed now. When these removal plans were announced I asked what the plugin would do with objects it cannot handle. I never got a reply. So I guess they will just end up in limbo.

Re: Import errors

PostPosted: Sat Mar 15, 2008 5:25 pm
by Aloys
As it stands now the plugin stops importing as soon as it encounters a problem of some kind, and any other objects that it would have succesfully imported before stopping is lost? Is that correct?

Re: Import errors

PostPosted: Sun Mar 16, 2008 12:26 am
by Trylon
Yeah, those objects are limboed.

And indeed, to the frustration of myself and many others, the importer stops importing when it encounters an error.

Re: Import errors

PostPosted: Tue Mar 18, 2008 4:35 am
by Robert The Rebuilder
Bump.

Again - would someone check in these files for me to fix the import issues in the plugin?

Robert The Rebuilder wrote:OK - I have the fixes. I checked them into contrib/RTR; the files are