PyGrp

Help - Resources - Discussion
AngelSpirit
Posts: 1
Joined: Sun Dec 06, 2009 4:26 pm

Postby AngelSpirit » Sun Dec 06, 2009 4:29 pm

[quote name='bajadulce' post='8046' date='Nov 7 2009, 11:31 AM']
I think I added this feature (compiling .bmps of different dimensions) at least within the first couple versions of the program
Oh. I only just noticed this last week when I combined 2 different sets of .bmps and forgot to resize them to match as I normal have done.


poiuy, I tried to decompile my first .grp with the program last night, but get an error upon hitting the export frames button? I thought maybe it was my unusual .grp, and so tried several other SC default ones. All produced the same result.

Code: Select all

Exception in Tkinter callback
Traceback (most recent call last):
  File "Tkinter.pyc", line 1404, in __call__
  File "PyGRP.pyw", line 702, in exports
  File "PyGRP.pyw", line 18, in grptobmp
TypeError: isstr() takes exactly 1 argument (2 given)

[/quote]

I get this error too, and I don't use the source version. Is there a way I can resolve this?
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Tue Dec 08, 2009 10:01 pm

There is currently no way to fix the bug in the EXE version, your only options are to either:
1) switch to the source version and I could give instructions on fixing it (on Windows this is quite easy, and I recommend it since its also usually very easy for me to tell you how to fix any bugs you might stumble upon).
2) wait for an update to the EXE version

Currently I don't know when the next version of the EXE's will come out since a lot of stuff is happening IRL and my lack of easily accessible Windows machine. Sorry for the inconvenience!
User avatar
Hydrolisk
Posts: 39
Joined: Mon Sep 15, 2008 8:39 pm

Postby Hydrolisk » Sun Jul 22, 2012 3:52 pm

[attachment=3072:zealot.zip]

PyGRP breaks on trying to open "legacy" GRP files. Such files work fine in SC and can be opened by RetroGRP (have not tested with SF's program).

I was wondering if you could have a look at the issue and see what's up.

I have attached an example GRP in case you want to analyze it.

Here are the error messages:

Code: Select all

Load Error: Unsupported GRP file 'F:BackupGamingStarCraftCustoms_Mod Directory and F-i-N DataAncient Modszealot.grp', could possibly be corrupt

Traceback (most recent call last):
  File "F:BackupGamingStarCraftCustomsTools and W-i-PPyMSLibsGRP.py", line 180, in load_file
    raise
TypeError: exceptions must be classes, instances, or strings (deprecated), not NoneType


EDIT:

I have another error with trying to export the frames of a BMP:

Code: Select all

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:Python25liblib-tkTkinter.py", line 1414, in __call__
    return self.func(*args)
  File "F:BackupGamingStarCraftCustomsTools and W-i-PPyMSPyGRP.pyw", line 702, in exports
    grptobmp(os.path.dirname(file), self.palettes[self.pal], self.uncompressed.get(), self.singlebmp.get() + self.thirdstate, self.grp, name, indexs, True)
  File "F:BackupGamingStarCraftCustomsTools and W-i-PPyMSPyGRP.pyw", line 18, in grptobmp
    if isstr(grp, unicode):
TypeError: isstr() takes exactly 1 argument (2 given)



I'm running my Windows 7 system with Japanese Locale. Might that have something to do with it?
Thank you for your time.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Mon Jul 23, 2012 3:30 am

The first issue will depend on the GRP, but I'm guessing most will be the same issue: being compiled slightly incorrect. The one you uploaded has frames with some pixel lines that are wider then the GRP so I reject it. The fix of course is just ignoring the extra pixels instead. To do this open GRP.py and replace lines 179-180:

Code: Select all

            if xoffset + linewidth > width or yoffset + lines > height:
               raise

with:

Code: Select all

            if xoffset + linewidth > width:
               linewidth = width-xoffset
            if yoffset + lines > height:
               lines = height-yoffset


The second issue can be fixed by replacing line 18 in PyGRP.pyw:

Code: Select all

   if isstr(grp, unicode):

with

Code: Select all

   if isstr(grp):
User avatar
Hydrolisk
Posts: 39
Joined: Mon Sep 15, 2008 8:39 pm

Postby Hydrolisk » Mon Jul 23, 2012 10:51 am

It works now! Thank you very much.
Thank you for your time.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Re: PyGrp

Postby Heinermann » Fri Jan 04, 2013 9:03 pm

Applied the saving/isstr fix.
Applied the "invalid GRP"/ignore extra bytes fix.
Fixed the show preview error.
Fixed additional errors when no frames are selected.

Return to “PyMS (poiuy_qwert's complete modding suite)”

Who is online

Users browsing this forum: No registered users and 1 guest