Color Picker

User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

Humm... just notice something with your Color Picker
Open Command History and your Color Picker
Clear the History
Move an object a few times
Click in your Color Picker
Press the trueSpace Undo icon
The last Undo is removed and added back with each press
No Undos are possible after that
User avatar
clintonman
Captain
Posts: 5422
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, 03:13 Humm... just notice something with your Color Picker
Open Command History and your Color Picker
Clear the History
Move an object a few times
Click in your Color Picker
Press the trueSpace Undo icon
The last Undo is removed and added back with each press
No Undos are possible after that
Yes, that's why there is a Undo Color button on the color picker. It is setup to only undo the color changes(ideally).
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

Oh, I see...
You press the Undo Color button first, then trueSpace's Undo to continue using it to Undo the previous undos
Nice!
User avatar
clintonman
Captain
Posts: 5422
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, 21:20 Since adding the WinID to both panels, I have not seen any issues so far and the X panel now adds SnappedTo, I guess from your OpenPanel script

I found a setting that works pretty good
TheNode

Code: Select all

if(Node.IsRenderable(firstSel)) {
	var selstr = colorSource.GetStringAt(4);
i = 1;
colorSource.SetSelectedString(selstr);
}
Also added:
if(Node.IsCamera(firstSel)) {
return
}
The IsRenderable check won't be needed. After I removed those exported child node color connections from the list the good color is found at index 0 for compiled and d3d materials. The only odd ball was the yafaray materials, I added a TODO note in the code
"shiny diff=3, glossy=5, coated glossy=7, glass=4, rough glass=5, yaf light=0, blend=7"
I already added your selection check for the UpdateConnChoice.
I'm going to see about adding the ORA option now.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
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 latest changes:

new option to not include object render attributes colors in the drop down list - looks nice and clean, option is on the default aspect

removed internal color nodes with exported connectors from the drop down list - now all default mesh colors are good except yafaray materials, still haven't checked other possibilites yet - mesh with hair, sds mesh, nurbs, skeletons, actors... bunch of stuff

changed the luminosity slider to update on change - using the color control won't add another luminosity undo

added a selection check for the update button

TODO list:

yafaray materials
closing x issue
untested object types
Attachments
Color Picker.RsObj
(544.6 KiB) Downloaded 43 times
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

Great update! :bananathumb:
The drop-down list is a huge improvement!
I will test a bunch tomorrow.
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

I looked at Shortcut Runner's panel setup in the UU
First of all, I was wrong having both panels WinID the same

The XCoverColorPickerPanelFrame's OwnedBy needs to be the same as the ColorPickerFrame's WinID

Edit: Random GUID Generator
lowercase or UPPERCASE :?:
I like UPPERCASE :mrgreen:

Code: Select all

// guidGenerator 
// Called to execute the command 
function Execute(params)
{

	params.ConValue("myguid") = guid();

}

function S4() {

	return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}

function guid() {


	//return ("{" + S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4() + "}");
	return ("{" + S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4() + "}").toUpperCase();
}
GUID Generator.png
GUID Generator.png (5.55 KiB) Viewed 463 times
.
Color Picker toolbar icon
Color Picker.png
Color Picker.png (7.69 KiB) Viewed 461 times
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

Getting a few errors with the Update button
It may be a selection issue, like when you change the color picker's selected object to a different material.
Selecting the color picker's selected object again seems to help.

ERR Source object: /Scripts/CustomCommands/Color Picker/UpdateConnChoice Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 28, Char: 1 Script text: color = Node.Value(ActiveObject, ActiveConn);

I think you may need to make this script use a try&catch with an Alert "Selection lost."


Getting a lot of Border color attributes in the drop down list
I do not think these are of any value.
Is there any way to bypass a connector name: "Border color"?
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

Yay, I did it! :D
TheNode script
if(connector[1]=="Border color") continue;
User avatar
clintonman
Captain
Posts: 5422
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, 19:48 ...

I think you may need to make this script use a try&catch with an Alert "Selection lost."
...
No thanks. try catch is the worst solution to any programming problem.
Clinton Reese

http://clintons3d.com
Post Reply