Jump to content

Any possibility of load options for a plugin?


aybe
 Share

Recommended Posts

In PropertyBasedFileType I've noticed the overload for save options, but there's nothing similar for load.

Basically, like when you open a raw audio or image in other software, you can choose settings and pray they're correct.😅

In my case it isn't that extreme, it's just that the TIM format, while having transparency info, actually it isn't always desired.

Long story short, TIM can be a texture atlas and most generally is, also with a different depth and palette for each image. 😆

So ideally, if there's a way to show some GUI before image loading or some other approach that'd work it'd be amazing!

 

tim2view_win32_i386_EI82XSxXLw.jpg

tim2view_win32_i386_hoI7cQEptj.jpg

Link to comment
Share on other sites

Here's a concrete example of the challenge, this is the same TIM file, it has two palettes, first is for the characters, second is for the GUI:

 

STATUS_000001_08b_02c.png.ad102d0cb684e1a13df529260cf7e29a.png

 

STATUS_000001_08b_01c.png.65c35587a38be62fadb5c9b862f36bca.png

The more I am thinking about it, the trickier it appears to be achievable from within a PDN plugin... generating 1 layer per palette wouldn't make much sense as there can be dozens and all of them but 1 would work for a sub-image in the surface.

 

And then, loading is a thing but saving is another totally different thing, how could one specify what palette is for what region, etc.

If that wasn't complex enough, TIM can hold 4-bit and 8-bit images simultaneously... this is because of limited VRAM in the PSX.

 

Still, any ideas or suggestions are welcome! 😀

Edited by aybe
Link to comment
Share on other sites

32 minutes ago, aybe said:

In PropertyBasedFileType I've noticed the overload for save options, but there's nothing similar for load.

 

You can show a dialog in OnLoad, the Icon, Cursor, and Animated Cursor plugin does this to allow users to select which icons to load.

But this is not officially supported by Paint.NET, e.g. cancelling the load dialog causes Paint.NET to show an error message to the user.

 

11 minutes ago, aybe said:

Here's a concrete example of the challenge, this is the same TIM file, it has two palettes, first is for the characters, second is for the GUI:

 

Many game texture formats tend to use tricks like that.

The usual solution for those formats is to have an editor that can import and export images, while allowing the user to set the palette assignment and other details.

It would be fairly difficult to support those specialized features in a Paint.NET plugin.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Haven't though about that actually, indeed a message box (or more) solves this problem more or less elegantly!

 

For the second, I'm starting to realize the trouble I've put myself in. 😁

 

While loading a TIM file is straightforward, providing the full TIM user experience from PDN looks just impossible to me...

 

The problem is that it's impossible to know and assign palettes from PDN, unless rewriting a full-blown software from within PDN, at the mercy that some thing might be not allowed by PDN at some point.

 

The plugin that loads all TIM format is here https://github.com/aybe/pdnTimFile, but unless one finds a way to address these issues, it has become to a halt.

 

LEWGx6xiwd.thumb.jpg.8062d4b834f7ba851c7bbbccac068d93.jpg

Thanks mate😀

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...