armory3d / armortools

3D Content Creation Tools
https://armorpaint.org
Other
3.24k stars 336 forks source link

Allow Pasting in Hex-Color selector #889

Closed MathemanFlo closed 3 years ago

MathemanFlo commented 3 years ago

Base color in MaterialOutput node and RGB node can be configured in three ways. RGB, HSV and Hex. The latter is implemented by a textedit control. This control allows copying the value (ctrl+c, no context menu) but no pasting using ctrl+v. It would be great if ArmorPaint could support pasting hex colors as it would ease color transport to ArmorPaint and between nodes.

@luboslenco Thanks for fixing four bugs on a single day. Great work! ArmorPaint gets better and better. On saturday I used it for 8h without a single crash and without any show stopping issues. It was amazing. I'm also looking forward to Armorlab. Sounds like it is a tool I always wanted to have.

luboslenco commented 3 years ago

That's super cool to hear! Glad for all the bug reports, it helps so much. What is the format of Hex string you are pasting using ctrl+v? It should already work, looks like there is a bug.

MathemanFlo commented 3 years ago

It's very motivating to see the bugs disappear so quickly (most of them are not severe anyway) and I really like the whole concept of the program. It's exactly what I was looking for. I only tried something like ff0000 (red) so far but now I tried

FF0000 ff0000 ffff0000 FFFF0000 0xFF0000 0xff0000

None of them can be pasted (It happens nothing). I think in practise the first two are the most frequent ones, right? Gimp, Paint.net, Photoshop, Most color tools use this format. The first two f in the 8-digit representation are for alpha-transparency I guess? If I type (not paste) something like aaff0000 it gets automatically converted to ffff0000.

luboslenco commented 3 years ago

Hm are you able to paste anywhere else, for example into the material name field in the bottom right corner? I tried pasting FF0000 into the hex field and it seems to work here for some reason.

Edit: Yes, the first two are for alpha.

MathemanFlo commented 3 years ago

This is a good idea. Funnily I'm able to paste to layer/image name edit control but not to material/brush name edit control (shader editor). Maybe this is somehow a platform dependent problem in keybord event handling/shortcut mapping? What OS are you using? The two machines I tried are both windows 10. @AlexKiryanov Are you able to reproduce it on your win10 machine?

I tried all positions I could find ap1 Also pasting to brush's name edit does not work. Now I think it is not related to the control itself but where it is. Maybe the shortcut is caught by the wrong handler (i.e. the Shader editor's handler for pasting nodes?)

In addition I realized that the HEX edit for swatches is somehow useless because it is instantly closed by clicking.

Edit: But alpha does not work, does it? A color is a triple and in the future there will be an additional slot for alpha?

luboslenco commented 3 years ago

Aha, I can reproduce it with the layer 2D view open, great catch! Fix incoming.

MathemanFlo commented 3 years ago

Yes, you are right! Didn't realize that because 2D is always open. Good observation!

AlexKiryanov commented 3 years ago

Hello everyone) If I understood everything correctly what is written, then ... Inserting color in the form of hex numbers works for me, but not always. But I honestly cannot understand the reason and reproduce exactly why this is happening. When I was doing the Nutcracker lesson, I had such problems.

MathemanFlo commented 3 years ago

@AlexKiryanov Thank's a lot for the quick reply. I think genious @luboslenco nailed it down to whether 2D-view (image view) is open or not. I guess you unknowingly experienced the same.

AlexKiryanov commented 3 years ago

image so I copied and pasted FF0000. And it works without problems.

AlexKiryanov commented 3 years ago

@AlexKiryanov Большое спасибо за быстрый ответ. Я думаю, гениальный @luboslenco решил, что 2D-просмотр (просмотр изображений) открыт или нет. Полагаю, вы сами того же не осознали.

Damn it, you're right. Indeed, when the 2D view is open, it not works. This is where the problem turns out to be. Florian, you're done! You find such mistakes that I would never have thought))) And not which I just do not pay attention) Thank you very much! If you need to test something, write) I'm here)

MathemanFlo commented 3 years ago

@AlexKiryanov Thank's a lot but you also found lots of issues. I find most issues by using ArmorPaint. In case something differs from my expectation I take a closer look and try to find out whether the source is my lack of artistic knowledge or an ArmorPaint bug. My second (and more developer-like ) strategy is to try out edge cases (like renaming texture files and trying to reimport them)

luboslenco commented 3 years ago

Hopefully all well now via https://github.com/armory3d/zui/commit/94c6ebece4a076f2e6a9405fe8564570c090ed6f.

MathemanFlo commented 3 years ago

Awsome! Works for me now! :-)

AlexKiryanov commented 3 years ago

Thanks you Lubos. I checked tomorrow)

ср, 28 апр. 2021 г., 21:47 MathemanFlo @.***>:

Awsome! Works for me now! :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/armory3d/armorpaint/issues/889#issuecomment-828695512, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRY3VIBEUOVR37BUI3YW43TLBJ5TANCNFSM43TQUICQ .

AlexKiryanov commented 3 years ago

Awsome! Works for me now to!