Skip to content

[Feature] Image to Canvas Import/Export#4

Open
dersekret-cmyk wants to merge 4 commits into
Star-F0rce:mainfrom
dersekret-cmyk:main
Open

[Feature] Image to Canvas Import/Export#4
dersekret-cmyk wants to merge 4 commits into
Star-F0rce:mainfrom
dersekret-cmyk:main

Conversation

@dersekret-cmyk
Copy link
Copy Markdown
Contributor

I thought the feature was a good idea and couldn't think of a reason why it shouldn't work.
Only Problem is a Mii without Facepaint will have a buggy facepaint until you enter makeup editor for in preperation Miis.
NOTE: I have not tested Existing Miis with or without Facepaint. In preperation Miis work when there's already a saved Mii and if there isn't.

This one was way messier then the Last Feature because I thought my code had a bug I couldn't find for 2 hours when in reality I just forgot to call python when trying to execute the script ...

This was a lot more work than initially thought. I added the ctype .dll in ./lib for windows users linux users should'n have to download anything for it to work as the .so is included in most systems.
This added a export png and import png mode to the apps Modes.
I also added a customizable tooltip icon to the modes. As of right now I made it so only when going into 'Import Facepaint' Mode the tooltip gets set. Other modes don't have a tooltip but they can be added pretty easily
I put in some failsaves and added the backup-feature to the import mode, I haven't tested importing a facepaint onto a Mii that already exists tho.

Important to NOTE: I wasn't sure what the negative canvas is actually used for so I created both files even tho the canvas file is the 'real' image file so I added both I forgot to add the Dummy Mii so at least for using temp Miis to apply the Facepaint correctly you need to go into the Makeup menu that will refresh the miis facepaint data and apply the imported image.
I'm sure I changed other stuff but I was stuck at it not working because I forgt to type python when trying to execute the scripts and was stuck figuring out what was wrong with the code for 2 hours until I noticed.
@dersekret-cmyk
Copy link
Copy Markdown
Contributor Author

One more addition this Mode can Probably be used for Houses and stuff as well but rn it is hardcoded for Miis but the system would be the same just different memory access logic

@Rafacasari
Copy link
Copy Markdown

Why import a dll? Can use either the https://pypi.org/project/zstd/ or the built-in (added in 3.14) compression.zstd https://docs.python.org/3/library/compression.zstd.html

@dersekret-cmyk
Copy link
Copy Markdown
Contributor Author

You are free to change it honestly.

But there's multiple reasons actually.
The built in zstd support is added in 3.14 so can't use that since older python version wouldn't be able to use the programm anymore. Since there's no venv here that would be problematic for people who run the source code.
Most Linux distros use this as a system library so using whatever the given system has to offer reduces redundancy and just uses what the system can use therefore limiting errors.
It keeps the requirements.txt to the minimum and makes no difference for the pyinstaller package when compiled for windows.
You could argue that it doesn't make sense to include it since linux users would need to download the dll they don't need but I'd rather have it there than having people to search it themselves especially since it can then be compiled for whatever system is needed.
I noticed tho that I completely ignored MacOS (I usually do that since I have no way of testing it anyways) and that there's actually a potential Bug in that try block I didn't fix yet.
Using https://pypi.org/project/zstd/ would be objectively better for cross system compatibility but I honestly didn't even look into it I knew that C library existed so I used it and made sure it was selfcontained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants