PyGrp

Help - Resources - Discussion
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Nov 06, 2009 2:27 pm

Hey really nice program! I really like how all the different palettes are right there at your fingertips. With SFGRPConverter, I find myself always browsing for my palette folder. The preview feature/viewer is obviously a huge advantage over other compilers and the ability to skip frames is a nice feature. I'll have to start compiling some things with it soon and prob make this my main .grp compiler. I've used it up till now as mainly a way to get a quick peek at a .grp without having to decompile.

I'm glad you like it! I'm quite pleased with how PyGRP turned out. Oh, and if you didn't notice I added support for choosing the transparency index, so you no longer need to use black as your background color.

One funny thing to report. Not necessarily a "bug", but a way to crash the thing. If you deselect the "show preview" button for whatever odd reason one would do this, reopen a .grp, and then press the move frames down button, you'll get this:

Code: Select all

Exception in Tkinter callback
Traceback (most recent call last):
  File "Tkinter.pyc", line 1404, in __call__
  File "PyGRP.pyw", line 226, in <lambda>
  File "PyGRP.pyw", line 799, in shift
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int'



Ok.. more to report after I experiment and actually use the tool.

:o Thanks, I'll look into it!
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Nov 06, 2009 6:37 pm

The transparent index is only related to the BMP's. In GRP's no index is transparent, there are just colors 0-255 and "blank". So index 0 in StarCraft is actually black. What happens is the GRP converter just reserves a certain index (which has generally been index 0) to represent the "blank" parts in the BMP when importing/exporting. So now being able to change the transparent index lets you choose any color in the palette for the background, instead of having to use a custom palette to change index 0's color. For custom palettes just put them in the Palettes folder, but you're right, PyMS doesn't support .act pallets ATM. I'll rectify that in the next version but you'll have to convert it to one of the formats accepted by PyPAL for now. Thanks for the support!
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Sat Nov 07, 2009 12:15 am

[quote name='bajadulce' post='8031' date='Nov 6 2009, 05:57 PM']The index makes a little more sense now. I wanted to give this transparent index a try rather than add my custom green background unit palette, but couldn't seem to figure out how to change it. The button always appears to be "grayed" out, even when I select "new"?[/quote]
It's currently only changeable when no GRP is open. Once a GRP is open it would be too much work to convert the indexes (actually I thought of some things that i might be able to change to make it possible to modify the index while open). If you are opening a GRP just make sure no GRP is open, change the transparent index and open. Another limitation that I can probably overcome (as per the ideas i had above) is that if you have a GRP open with transparent index X, you can't import BMP's with transparent index Y. To get any old BMP's to use the correct transparent index you'll need to open a new GRP that has index Y as transparent, import them, save and close the GRP, then change the transparent index to X, open the GRP, and export the BMP's. Of course if you already have a GRP with those frames you can just use that.

[quote name='bajadulce' post='8031' date='Nov 6 2009, 05:57 PM']The move frame down, move frame up, delete is incredibly powerful tool as I now see what it does. This will save lots of trouble when dealing with screwed up .grps that have frames out of whack.

Having the frames indented by groups in the left fame window is a nice feature that helps with organization.[/quote]
Agreed.

[quote name='bajadulce' post='8031' date='Nov 6 2009, 05:57 PM']I notice there is a tool tip for the single bmp frameset checkbox, but the others like compressed/uncompressed could benefit from a quick explanation of what they do. The Green box is quite obvious, but the red outline wasn't at first. I see now it represents the perimeter of the furthest pixels. I imagine this is helpful in that it would signify any stray pixels where they shouldn't be. i.e. ppl that use black for a transparent background seem to suffer from this a lot! :)[/quote]
There is a tooltip for the "single bmp" option because I kinda overloaded that checkboxes use with another somewhat hidden option (click the check to use frameset output, click it again to get SFGRPConv output, and a third click will turn it off). Looking back i think its a bad idea on my part, i'll probably change it to just three radiobuttons in the next version.

[quote name='bajadulce' post='8031' date='Nov 6 2009, 05:57 PM']I compiled my first set of .bmps, but missed being able to just select one .bmp and then type in the # of corresponding .bmps. Instead, you have to highlight all of your desired .bmps. This is fine as most ppl know how to use shift-click and cntrl-click when selecting files. A lot of times my working grp folder has a lot of other crap in it tho. Do I have to be extra careful not to include other .bmps that aren't part of the numbered set? With SFGrpCon, it just weeded out what it wanted and didn't. The command line pyGrp prob does the same I'm sure.[/quote]
I used to do it where you would just select your first BMP and it would find all the similarly named bmps and import them all, but it required the names to be "<name> <n>.bmp", and people really wanted to just select all their bmps so i changed it. You're correct about the command line.

[quote name='bajadulce' post='8031' date='Nov 6 2009, 05:57 PM']What's a good way to convert my .act files to something pyPal or pyGrp uses? Can photoshop or paint save in any of these formats?[/quote]
They should be able to. If not I could always take a look at them.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Sat Nov 07, 2009 1:47 am

[quote name='bajadulce' post='8035' date='Nov 6 2009, 07:52 PM']I see, you have to exit pygrp and then restart the program to change those values.[/quote]
No no just close the open GRP not close PyGRP. It's the 5th button on the toolbar.

[quote name='bajadulce' post='8035' date='Nov 6 2009, 07:52 PM']I wanted to change to that first green in units.pal, but was having a hard time counting that far in my photoshop palette window. "16,32,64... bah forget it. Hey, wait, didn't I see that pyPAL lists the indexes if you hover over the color?" :) Ok so I got index 117 as the first green in units.pal by using pyPal. I entered this value in the transparent index box, but it displayed the .grp as still using a black background and all the colored border boxes were really screwed up? Did I input those numbers correctly?[/quote]
Remember the transparent index is only for the BMP's exported/imported into PyGRP. If you want to changed the background color of the preview (this color is independent of the transparent index) just double click the preview. The frame/grp outlines being different is either a bug, or you may have just misunderstood my description: The BMP's you are importing have index 0 representing transparent, if you change the transparent index in PyGRP to 117 and then try to import them, PyGRP is looking for index 117 to represent transparent, not 0. This could be why the borders screw up since now all the 0's are solid black, not transparent, you just cant tell since the preview background is black. If you refer back to my other post I explain how to overcome this problem with having old BMP's with different transparent indexes, and once your old BMP's are dealt with you'll no longer have to worry about this (or if the next version of PyGRP comes out before that and my plan works :P)

[quote name='bajadulce' post='8035' date='Nov 6 2009, 07:52 PM']Yes, I can confirm photoshop saves in .pal, but after dropping this into the palette folder in pyms, it doesn't appear to show up on the PyGrp's windowed list? Is there some other setting or folder I have to put this in?[/quote]
Hmm, looks like you'll have to restart PyGRP to get the list to update, and if it still doesn't update after that then thats weird. Anyway, I'll probably make the list auto-update next version.

[quote name='bajadulce' post='8035' date='Nov 6 2009, 07:52 PM']
I used to do it where you would just select your first BMP and it would find all the similarly named bmps and import them all, but it required the names to be "<name> <n>.bmp", and people really wanted to just select all their bmps so i changed it
Why? :) Having all the palettes right there in the window is a huge advantage over having to "browse" for palettes as is needed in SFGrpConv. All the other features of pyGrp blow other converters out of the water as well. This one feature of having to manually select ALL .bmps is a bummer tho and SFGrpConv wins in this category for guys like me that don't need anything but a quick way to convert a bunch of .bmps the majority of the time. I see the import frames for the single .bmp compiler requires input.
[/quote]
Well I just went with demand and my experiences (since I always keep my GRP frames organized in folders). I'll probably add the option in the next version.
User avatar
ShadowFlare
Posts: 15
Joined: Tue Apr 15, 2008 7:23 am

Postby ShadowFlare » Sat Nov 07, 2009 5:35 am

As far as palettes, there are 4 formats my converter supports, two which are supported internally by my grp library and two that the converter adds. The original two supported were .act palettes from Photoshop (also same format as .ppl from WarCraft 2) and the .wpe files from StarCraft. The other formats that the converter supports are RIFF (a binary format) and JASC (a text format), both of which use the .pal extension typically.

When opening a palette, my converter ignores the extension, only looking at the contents to figure out the format. First it checks for RIFF, which starts out with "RIFF" for the first four bytes, then a 4 byte value indicating the size of the file - 8 (excludes the RIFF tag and the size field), then the 4 byte text string "PAL ". There's some more to the format, but that's basically how the program checks for that format. If that was not a match then next it checks for the JASC palette format, which starts with the "JASC-PAL" tag. After this, the converter passes control to the function in my grp library for loading palettes. That code first checks for whether the file is exactly 1024 bytes (256 entries times 4) for the .wpe format that StarCraft uses. This format simply uses a flat array of RGB values stored as 4 bytes each. Lastly, if all other checks failed, it assumes it is a .act/.ppl palette, which is a flat array of RGB values stored as 3 bytes each. Since this is the final fallback format, it accepts any file size, so my converter will actually allow one with less than 256 colors, if this ever occurs.

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

Who is online

Users browsing this forum: No registered users and 1 guest