Greetings,

After trying to import a new 3ds model an exception is raised during
converting the 3ds to world;

_3DS2soya.py, line 258, in process_next_material_chunk
   mat.setName(material_name)
AttributeError: 'Material' object has no attribute 'setName'

I'm using the windows 0.11 binary version, but the problem seemed to
exist in SVN so I suppose it's broken? I fixed this by replacing the

mat.setName(material_name)  with mat.name = material_name

This seemed to work, but only partially. My 3ds object (which I used
few months back succesfully) has 2 textures, but only the first one
worked. The second texture didn't appear, leaving only white color on
the surface.

After some more digging, I found the problem (lines 189-194)

else:
   material_found=1                                             
   for mat_counter in range(0,len(materials)):                                  
                
       if materials[mat_counter].name==material_name:
           mat_index=mat_counter
           break

The above piece of code is inside another for-loop (starts at line
184). When the correct material is found, it does not break from the
loop. This, then, results that the loop will try to find the material
again, which it wont be able to do anymore, thus setting
material_found=0

I got over from this problem by adding an additional break after the
for loop. It shouldn't cause any problems as the existance of the
material has already been verified on line 185. I'd also suggest using
a more simpler approach (works for me, at least for the moment of
being):

else:                                           
   material_found=1
   for mat_index,material in enumerate(materials):
       if material.name == material_name:
           break
   break

With this, I got the 3ds importer work like it should at least for my
model. Any comments on the matter?


Cheers,
snaip

_______________________________________________
Soya-user mailing list
[email protected]
https://mail.gna.org/listinfo/soya-user

Reply via email to