Color Picker

User avatar
clintonman
Captain
Posts: 5429
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: 26 Jan 2023, 23:50 Yep!
If you add the following you can see this behavior.
TheNode script

Code: Select all

if(Node.IsRenderable(firstSel)) {
	var selstr = colorSource.GetStringAt(4);
i = 1;
colorSource.SetSelectedString(selstr);
}
OK I notice a problem with your change. Looks like it's based off of :

Code: Select all

	if(Node.IsLight(firstSel)) {
		var selstr = colorSource.GetStringAt(0);
		i = 1;
		colorSource.SetSelectedString(selstr);
	}
That i = 1 line really means 0 + 1 [GetStringAt(0)],
so your i = 1 should be 4 + 1 [GetStringAt(4)]
Try that and see if it works any better.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Color Picker

Post by clintonman »

I have an update on the luminosity "changing" from just opening the system color picker. The problem is the slider. If it is not set to update on change then when you 1. change slider 2. open the system color picker, the lum connector will fire and try to run luminosity scripts. When the slider is set to update on change then it doesn't fire the watchdog.
This is totally typical of the craziness of this whole thing. :roll:

Wow, just did another test. This time I had a light selected, opened the color picker and changed the luminosity slider. Next I just clicked on the color control on the light, not double click, and the luminosity script fired off. I think trueSpace might be evil :twisted:

I didn't want to use update on change for luminosity. So time to figure a way around that craziness.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5429
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: 26 Jan 2023, 19:17 ...

Been noticing the Panel X being left open on several occasions.
Edit: Both panels are missing a WinID. I added {F021DF25-F4AA-41DD-86CC-8FF15C2E278A} to both panels

...
I missed your edits.
I added that change to the WinID of both panels and it didn't change anything.

If you double click the square color control and cancel will the x button still be visible?
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

clintonman wrote: 27 Jan 2023, 00:48
trueBlue wrote: 26 Jan 2023, 19:17 ...

Been noticing the Panel X being left open on several occasions.
Edit: Both panels are missing a WinID. I added {F021DF25-F4AA-41DD-86CC-8FF15C2E278A} to both panels

...
I missed your edits.
I added that change to the WinID of both panels and it didn't change anything.

If you double click the square color control and cancel will the x button still be visible?
I do not know what you mean by Cancel
First of all, did you press the Kill button?
If so, did you close trueSpace before using your Color Picker?
For me, the Kill button causes this behavior.
Shortcut Runner uses the X close panel and does not have any issues that I am aware of
Maybe the problem is in your OpenPanel script
User avatar
clintonman
Captain
Posts: 5429
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: 27 Jan 2023, 01:28
clintonman wrote: 27 Jan 2023, 00:48
trueBlue wrote: 26 Jan 2023, 19:17 ...

Been noticing the Panel X being left open on several occasions.
Edit: Both panels are missing a WinID. I added {F021DF25-F4AA-41DD-86CC-8FF15C2E278A} to both panels

...
I missed your edits.
I added that change to the WinID of both panels and it didn't change anything.

If you double click the square color control and cancel will the x button still be visible?
I do not know what you mean by Cancel
First of all, did you press the Kill button?
If so, did you close trueSpace before using your Color Picker?
For me, the Kill button causes this behavior.
Shortcut Runner uses the X close panel and does not have any issues that I am aware of
Maybe the problem is in your OpenPanel script
DoubleClickLoseX.jpg
Double click the color control , choose cancel and lose the special X
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

I had to do that several times before I lost the X Close panel, but yes, confirmed
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

I really think that using RsApp.HistoryLength = 1 in the Clickable Bitmap Control(s) could be a better process
Here is another example.

Code: Select all

RsApp.HistoryLength = 1
util = System.CreateDO("Clintons3D Package/Utility functions")
util.SetNodeValueFloat('%THIS_NAME%/Color Format', 'inR', %COLOR_R%)
util.SetNodeValueFloat('%THIS_NAME%/Color Format', 'inG', %COLOR_G%)
util.SetNodeValueFloat('%THIS_NAME%/Color Format', 'inB', %COLOR_B%)
Aftrer dragging to change the color, you have to press the Set button to restore the HistoryLength

Code: Select all

	history = Node.Value('Preferences/Desktop', 'Undo/Redo')
	RsApp.HistoryLength = history
	RsApp.Undo()
Attachments
Color Picker.RsObj
(104.3 KiB) Downloaded 39 times
User avatar
clintonman
Captain
Posts: 5429
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: 27 Jan 2023, 02:16 I really think that using RsApp.HistoryLength = 1 in the Clickable Bitmap Control(s) could be a better process
Here is another example.

Code: Select all

RsApp.HistoryLength = 1
util = System.CreateDO("Clintons3D Package/Utility functions")
util.SetNodeValueFloat('%THIS_NAME%/Color Format', 'inR', %COLOR_R%)
util.SetNodeValueFloat('%THIS_NAME%/Color Format', 'inG', %COLOR_G%)
util.SetNodeValueFloat('%THIS_NAME%/Color Format', 'inB', %COLOR_B%)
Aftrer dragging to change the color, you have to press the Set button to restore the HistoryLength

Code: Select all

	history = Node.Value('Preferences/Desktop', 'Undo/Redo')
	RsApp.HistoryLength = history
	RsApp.Undo()
If you open the other aspect of the color picker there is an undoable checkbox that can be unchecked if you don't want any undos.

Using this color picker:

1. move object in 3d view
2. drag or click in the color picker
3. undo for object move is gone
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Color Picker

Post by clintonman »

clintonman wrote: 27 Jan 2023, 00:40 I have an update on the luminosity "changing" from just opening the system color picker. The problem is the slider. If it is not set to update on change then when you 1. change slider 2. open the system color picker, the lum connector will fire and try to run luminosity scripts. When the slider is set to update on change then it doesn't fire the watchdog.
This is totally typical of the craziness of this whole thing. :roll:

Wow, just did another test. This time I had a light selected, opened the color picker and changed the luminosity slider. Next I just clicked on the color control on the light, not double click, and the luminosity script fired off. I think trueSpace might be evil :twisted:

I didn't want to use update on change for luminosity. So time to figure a way around that craziness.
Quoting myself. I changed the luminosity slider to update on change and it wasn't bad like I thought. I had already lowered the resolution of the image so it updates fast enough to be usable even with update on change active.
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

This is true, but without using RsApp.HistoryLength = 1, you lose undos while dragging
If a User has 20 undos set in the Desktop, the undos are lost really fast!
Post Reply