Bugfix: Don't generate different mipmap names on every run

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Bugfix: Don't generate different mipmap names on every run

Postby Christian Walther » Sun Aug 10, 2008 11:23 am

http://svn.guildofwriters.com/pyprp/contrib/CWalther/stable r320 fixes the following bug:

When two materials in Blender use the same texture image, but with different mipmap settings, PyPRP tries to choose unique names for the two exported plMipMap objects. However, it doesn't do a particularly good job at it: Assuming a file name of texture.png, the first time it is run in one Blender session, it chooses texture.png and 1-texture.png. The second time, it chooses texture.png and 2-texture.png, the third time texture.png and 3-texture.png, and so on, counting up the number in front of the second name.

This has several disadvantages:
  • exporting takes a long time when the same image is compressed again every time (under a new name),
  • the TexCache folder fills up with useless identical files,
  • the generated PRP files are different every time, even for identical input.

With the mentioned change, PyPRP generates identical output files when run several times on the same input (except for the sum file that records the modification time of the other files).

Besides, the previous method didn't actually generate unique names - it didn't check whether 1-texture.png in the example above was already taken (by a user-provided file of that name). This is fixed too.

Please review and merge.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Bugfix: Don't generate different mipmap names on every run

Postby Nadnerb » Sun Aug 10, 2008 2:46 pm

This has been merged to the trunk and 1.5 branch.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Bugfix: Don't generate different mipmap names on every run

Postby Christian Walther » Mon Aug 11, 2008 11:09 am

Thanks, that was fast!
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Bugfix: Don't generate different mipmap names on every run

Postby Trylon » Mon Aug 11, 2008 11:47 am

Thanks for the bugfix btw.
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron