Random Colors from palette

Here everybody can post his problems with PhotoLine
Antworten
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Random Colors from palette

Beitrag von Juan »

Hi all,

I have created my custom color palette over the Document Color List and a serie of vector objects inside a group. Now, what I would like to do is randomly apply specifically those colors from that palette to the objects inside the group.

This could be really helpful for archviz where we can show a "live" preview to customers on different colour options for facades for example if there is a random seed value.
Color.JPG
Color.JPG (37.65 KiB) 2013 mal betrachtet
Cheers,
Juan
Martin Huber
Entwickler
Entwickler
Beiträge: 4159
Registriert: Di 19 Nov 2002 15:49

Re: Random Colors from palette

Beitrag von Martin Huber »

Juan hat geschrieben: Mo 25 Mär 2019 14:19I have created my custom color palette over the Document Color List and a serie of vector objects inside a group. Now, what I would like to do is randomly apply specifically those colors from that palette to the objects inside the group.

This could be really helpful for archviz where we can show a "live" preview to customers on different colour options for facades for example if there is a random seed value.
The attached script should do this on Windows. Either execute it from Explorer or add it to "Filter > Scripts" by copying it to "%appdata%/PhotoLine/Automation" (create the "Automation" folder, if it doesn't exist yet).

You should use this script in combination with the latest beta version of PhotoLine (21.40B11), because scripting is constantly enhanced.

Martin
ApplyRandomColorsToGroup.vbs.zip
(1.24 KiB) 64-mal heruntergeladen
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Random Colors from palette

Beitrag von Juan »

Martin Huber hat geschrieben: Mo 25 Mär 2019 17:59 The attached script should do this on Windows. Either execute it from Explorer or add it to "Filter > Scripts" by copying it to "%appdata%/PhotoLine/Automation" (create the "Automation" folder, if it doesn't exist yet).

You should use this script in combination with the latest beta version of PhotoLine (21.40B11), because scripting is constantly enhanced.

Martin
ApplyRandomColorsToGroup.vbs.zip
It works perfect, thank you so much.

In script, can we make a popup window where I can have a button to regenerate the randomness, instead of calling the script every time?

Cheers,
Juan
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Random Colors from palette

Beitrag von Juan »

I'm sorry to keep with asking about this, but would it be possible to add randomly only some selected colours from the Document list?
selected colors.jpg
selected colors.jpg (13.66 KiB) 1956 mal betrachtet
Cheers,
Juan
Martin Huber
Entwickler
Entwickler
Beiträge: 4159
Registriert: Di 19 Nov 2002 15:49

Re: Random Colors from palette

Beitrag von Martin Huber »

Juan hat geschrieben: Di 26 Mär 2019 08:10In script, can we make a popup window where I can have a button to regenerate the randomness, instead of calling the script every time?
A script can't show non-modal dialogs. If you need to apply it often, you could assign a shortcut to the script.
Juan hat geschrieben: Di 26 Mär 2019 08:10I'm sorry to keep with asking about this, but would it be possible to add randomly only some selected colours from the Document list?
A script can't query the selected colors, but it is possible to show an input dialog. The attached script does that. By entering "2 4" the colors from your example will be used.

Martin
ApplyColorsToGroupWithInput.vbs.zip
(1021 Bytes) 63-mal heruntergeladen
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Random Colors from palette

Beitrag von Juan »

Martin Huber hat geschrieben: Mi 27 Mär 2019 10:51 A script can't show non-modal dialogs. If you need to apply it often, you could assign a shortcut to the script.
That is a good suggestion, thanks.
Martin Huber hat geschrieben: Mi 27 Mär 2019 10:51 A script can't query the selected colors, but it is possible to show an input dialog. The attached script does that. By entering "2 4" the colors from your example will be used.
Excellent, now it is perfect. I just wish I could know how to code, but my knowledge is bellow zero :oops:

Thank you again,
Juan
Antworten