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 »

trueBlue wrote: 06 Feb 2023, 01:44 The more I test this on older scenes, I find that I am running this Color Picker, blindfolded. 8-)
Finding some uncommon uses of color and without digging around in the LE, I do not know what the color is for.
It is really easy to unwantedly change the color and I find that I need to Undo it.
So, it would be convenient to have a tS Undo button on the panel.
If possible, it would be helpful if you could add a button that navigates to the item in the combo control.
And be able to select it and or show the item in the stack.
Edit: I know this is beyond a use of a Color Picker, but if you could show me how to add the Node Owner to an out string, I could add these buttons.
Maybe this will help get you started. It doesn't select it just makes an alert

Don't understand "add the Node Owner to an out string"
Attachments
SelectColorNode03.RsObj
(5.39 KiB) Downloaded 53 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: 06 Feb 2023, 05:14
trueBlue wrote: 06 Feb 2023, 01:44 The more I test this on older scenes, I find that I am running this Color Picker, blindfolded. 8-)
Finding some uncommon uses of color and without digging around in the LE, I do not know what the color is for.
It is really easy to unwantedly change the color and I find that I need to Undo it.
So, it would be convenient to have a tS Undo button on the panel.
If possible, it would be helpful if you could add a button that navigates to the item in the combo control.
And be able to select it and or show the item in the stack.
Edit: I know this is beyond a use of a Color Picker, but if you could show me how to add the Node Owner to an out string, I could add these buttons.
Maybe this will help get you started. It doesn't select it just makes an alert

Don't understand "add the Node Owner to an out string"
Excellent, thank you! :bananathumb:
I mis-stated Node.Owner, it was meant for opening the out string in the Link Editor
LE.OpenLocation(Node.Owner(Source))

I added Undo, Open in the Link Editor / Show in Panel buttons.
Screenshot (60).png
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 »

Got this error this morning when opening the Color Picker with nothing selected.
XCover was detached from the parent panel.

Code: Select all

ERR   Source object: /Scripts/CustomCommands/Color Picker/TheNode Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 71, Char: 1 Script text:  if(Node.ShortName(Node.FirstSelected()) == "Object Render Attributes") { 
I can duplicate the error it by using Node.Delete('') on an object first, then open the Color Picker.

I have been testing this tS Delete bug recently and have found that after you use Node.Delete(''), you should select something.
This makes Node.FirstSelected() active again.

XCover issue:
I suspect the way you are dealing with these floating panels is not working very well as shown above.
Shortcut Runner and Toolbar Manger in the UU9 are setup differently and have not seen this issue.
They both use the parent panel's WinID value in the child panel's OwnedBy value.
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: 07 Feb 2023, 14:06 Got this error this morning when opening the Color Picker with nothing selected.
XCover was detached from the parent panel.

Code: Select all

ERR   Source object: /Scripts/CustomCommands/Color Picker/TheNode Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 71, Char: 1 Script text:  if(Node.ShortName(Node.FirstSelected()) == "Object Render Attributes") { 
I can duplicate the error it by using Node.Delete('') on an object first, then open the Color Picker.

I have been testing this tS Delete bug recently and have found that after you use Node.Delete(''), you should select something.
This makes Node.FirstSelected() active again.

XCover issue:
I suspect the way you are dealing with these floating panels is not working very well as shown above.
Shortcut Runner and Toolbar Manger in the UU9 are setup differently and have not seen this issue.
They both use the parent panel's WinID value in the child panel's OwnedBy value.
Fixed error caused by Node.Delete('')
Changed nodes:

ColorFS
TheNode
UpdateColorMain
UpdateRGB
Update ColorRGB

copied winid to x panel owner - I forgot to do this and test it. The open panel assigns the owner after copying the files, but it seems like ownership has to happen before the copy to get good behavior

commented code in OpenPanel

Code: Select all

	//too late for reliable display of cover X
	//WindowsManager.SetFrameOwnerFrame(openedFrame, lastFrame);
removed close panel button

commented code in ReactivateControls because above fixes

Code: Select all

	//fix hiding x button

	//var WMS = WindowsManager.GetWindowsManagerNodeName();
	//if(Node.Exists(WMS + "/XCoverColorPickerPanelFrame")) {
	//	WindowsManager.ShowWindow(WMS + "/XCoverColorPickerPanelFrame", false);
	//	WindowsManager.ShowWindow(WMS + "/XCoverColorPickerPanelFrame", true);
	//}
Attachments
Color Picker1012.RsObj
(280.97 KiB) Downloaded 56 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 »

Thanks!
Previous versions used to clear the combo ctrl when you choose to unselect.
Is that a side effect of these changes?
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: 07 Feb 2023, 18:31 Thanks!
Previous versions used to clear the combo ctrl when you choose to unselect.
Is that a side effect of these changes?
How do you unselect?
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 »

Esc key shortcut and:
Unselect.png
Unselect.png (10.3 KiB) Viewed 741 times
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: 07 Feb 2023, 18:46 Esc key shortcut and:
Unselect.png
In TheNode move the code at about line 62

Code: Select all

	if(!colorFS.IsValidSelection(Node.FirstSelected())) {
		//Space.Unselect();
		params.SetTerminationFlag();
		return;
	}
down below about line 90 so it looks like this

Code: Select all

	if(ColorConnList.length == 0) {
		Node.Value(System.ThisOwner(), "ColorSource") = colorSource;
		params.SetTerminationFlag();
		return;
	}

	if(!colorFS.IsValidSelection(Node.FirstSelected())) {
		//Space.Unselect();
		params.SetTerminationFlag();
		return;
	}
Manual question:

Link Editor Navigator Toolbar
U : LMB unselect, RMB unselect and close all open object panels

Did you want to add to that to say what it would be used for? Why would I want to unselect?
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 »

Ugh, doing that brings back the error!
Can something be added to the PreTheNode script?
Link Editor Navigator Toolbar
U : LMB unselect, RMB unselect and close all open object panels
LMB Unselect - Unselects the selection and does not close the panel in the Stack.
RMB - Closes the panel in the Stack.
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: 07 Feb 2023, 20:26 Ugh, doing that brings back the error!
Can something be added to the PreTheNode script?
Link Editor Navigator Toolbar
U : LMB unselect, RMB unselect and close all open object panels
LMB Unselect - Unselects the selection and does not close the panel in the Stack.
RMB - Closes the panel in the Stack.
Do you want to add a reason why someone would want to unselect?
Clinton Reese

http://clintons3d.com
Post Reply