Color Picker

User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Color Picker

Post by clintonman »

Here are the changes to boost performance. The surprising thing is that reducing the pauses did not save as much time as I thought they would. It's faster than before. It still has a noticeable delay, even when the delay numbers are set low.

I changed the call to the Bitmap2 script to use Activity.Run instead of ScriptObject.Execute - still takes the same amount of time but control seems to be returned to the user faster.

Added an input to set the delay times. This is needed to get good undos when dragging in the controls. I set the default to 65. Running on an old centrino windowsxp machine needed a delay of 100 to get good undos. Decreasing the time made the undos less reliable. When just clicking in the controls, the delay time doesn't matter much and undos are good, but even set to low values there is a small delay. Might be able to work something out with 2 panel aspects, one for dragging and one for clicking where the delay can default automatically for each panel.

Removed the Source node connected to the watchdog and replace with the function set GetTargetNode function. This way there are no extra watchdog connections and the open buttons work without having to first make a selection in the list.
Attachments
Color Picker.RsObj
(348.69 KiB) Downloaded 51 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

clintonman wrote: 09 Feb 2023, 05:38 Here are the changes to boost performance. The surprising thing is that reducing the pauses did not save as much time as I thought they would. It's faster than before. It still has a noticeable delay, even when the delay numbers are set low.

I changed the call to the Bitmap2 script to use Activity.Run instead of ScriptObject.Execute - still takes the same amount of time but control seems to be returned to the user faster.

Added an input to set the delay times. This is needed to get good undos when dragging in the controls. I set the default to 65. Running on an old centrino windowsxp machine needed a delay of 100 to get good undos. Decreasing the time made the undos less reliable. When just clicking in the controls, the delay time doesn't matter much and undos are good, but even set to low values there is a small delay. Might be able to work something out with 2 panel aspects, one for dragging and one for clicking where the delay can default automatically for each panel.

Removed the Source node connected to the watchdog and replace with the function set GetTargetNode function. This way there are no extra watchdog connections and the open buttons work without having to first make a selection in the list.
ColorData
I removed the Red, Green, and Blue attributes because they are not being used.
On the Color panel aspect, I set the Link for Value, Red, Green, and Blue to None because Resetting them did nothing except add entries into the Command History.

Can GetTargetNode be used to set the Final Color, instead of using Node.FirstSelected()?
Just a guess, but I think it may help with the Lights that I posted about in the previous post where the selected node has to be re selected.
If the Selection Change Event could set the selected node's path to a string connector, then it would not be necessary for it to be selected in order to set the Final Color.
In simpler terms, somehow make the Color Picker aware of the selected combo string's color more often and set the Color Picker's Color attribute.
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

Noticed that the Undo button can undo the combo control string(s)
Change:
Undo Button script

Code: Select all

if(Node.Value('%THIS_NAME%/PreUpdate ColorRGB', ' Control Out') == 2) {
RsApp.Undo()
}
For whatever reason, running the above in a jScript does not work, it has to be run from a Button script. :roll:
Example: Undo Button script: Activity.Run('%THIS_NAME/Undo') does not work.
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

So, when you change the selected nodes Color and you want to update the Color Picker's Color, it is as simple as reselecting the item in the combo control.
Guess I will give up on this one and leave it up to the instructions on how to use this.
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Color Picker

Post by clintonman »

trueBlue wrote: 09 Feb 2023, 20:53 So, when you change the selected nodes Color and you want to update the Color Picker's Color, it is as simple as reselecting the item in the combo control.
Guess I will give up on this one and leave it up to the instructions on how to use this.
I dont follow what youre saying. "...It's as simple as...I give up"
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

I dont follow what youre saying. "...It's as simple as...I give up"
It's as simple as, reselect the combo control string.
I gave up trying to supply a script that solved this.
Post Reply