Color Picker

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

Re: Color Picker

Post by trueBlue »

The best I can tell, the Convert Selection is a two-part process.
If you do not do the first part (change the element mode) before using Convert Selection, it does not do anything.

The only thing I can think of, if it is possible, is add code to your OpenPanel script that stops it from opening if tS is in PE Mode
Is that possible?
Or at the very least, add:

Code: Select all

	if(Node.ConExists(Node.FirstSelected(), 'Selection')) {
	if(Node.Exists('Project/Windows Manager Space/ColorPickerFrame'))
		if(Node.Exists('Scripts/CustomCommands/Color Picker/ClosePanel'))
		ScriptObject.Execute('Scripts/CustomCommands/Color Picker/ClosePanel')
		return;
	}
User avatar
clintonman
Captain
Posts: 5431
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: 01 Feb 2023, 20:15 Couple other observations...
Color aspect
The Lum; Red; Green; Blue right click Reset does not do anything except add Undo entries to the Command History and Undoing them does not do anything. I changed the Link(s) to None.
The Integer2Number script has two OnDefaultValue functions.
The BufferColor does not need to be exposed. The Color attribute updates.
Exp aspect
There are two attributes that should be deleted.
The Icon is a Spotlight bitmap.
Tip: Left click - Iconize
Color.png
Cleaned connections.
RMB on icon, now it's black, not a light icon.
Removed extra OnDefaultValue stuff
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5431
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: 02 Feb 2023, 22:00 The best I can tell, the Convert Selection is a two-part process.
If you do not do the first part (change the element mode) before using Convert Selection, it does not do anything.

The only thing I can think of, if it is possible, is add code to your OpenPanel script that stops it from opening if tS is in PE Mode
Is that possible?
Or at the very least, add:

Code: Select all

	if(Node.ConExists(Node.FirstSelected(), 'Selection')) {
	if(Node.Exists('Project/Windows Manager Space/ColorPickerFrame'))
		if(Node.Exists('Scripts/CustomCommands/Color Picker/ClosePanel'))
		ScriptObject.Execute('Scripts/CustomCommands/Color Picker/ClosePanel')
		return;
	}
I don't know what the Convert Selection is about, or what it has to do with the Color Picker.

So the shortcuts didn't work?
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

Shift C works for me to open the Colot Picker and Convert Selection
I added the above code the OpenPanel script
I also added code to TheNode script:

Code: Select all

	if(Node.FirstSelected() == System.ThisOwner()) {
var colorSource = System.CreateDO("Common Data Package/String Enum Data");
colorSource.Clear();
Node.Value(owner, "ColorSource") = colorSource;
Space.Unselect()
		return;
	}

if(Node.IsCamera(Node.FirstSelected())) {
var colorSource = System.CreateDO("Common Data Package/String Enum Data");
colorSource.Clear();
Node.Value(owner, "ColorSource") = colorSource;
Space.Unselect()
return;
}
Also, to the function BuildColorConnList

Code: Select all

if(connector[1]=="Border color") continue
User avatar
clintonman
Captain
Posts: 5431
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: 03 Feb 2023, 23:12 Shift C works for me to open the Colot Picker and Convert Selection
I added the above code the OpenPanel script
I also added code to TheNode script:

Code: Select all

	if(Node.FirstSelected() == System.ThisOwner()) {
var colorSource = System.CreateDO("Common Data Package/String Enum Data");
colorSource.Clear();
Node.Value(owner, "ColorSource") = colorSource;
Space.Unselect()
		return;
	}

if(Node.IsCamera(Node.FirstSelected())) {
var colorSource = System.CreateDO("Common Data Package/String Enum Data");
colorSource.Clear();
Node.Value(owner, "ColorSource") = colorSource;
Space.Unselect()
return;
}
Also, to the function BuildColorConnList

Code: Select all

if(connector[1]=="Border color") continue
I see, I needed to read back a page to your earlier post.

So all the extra code is because the shortcuts worked?
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

clintonman wrote: 03 Feb 2023, 23:17
trueBlue wrote: 03 Feb 2023, 23:12 Shift C works for me to open the Colot Picker and Convert Selection
I added the above code the OpenPanel script
I also added code to TheNode script:

Code: Select all

	if(Node.FirstSelected() == System.ThisOwner()) {
var colorSource = System.CreateDO("Common Data Package/String Enum Data");
colorSource.Clear();
Node.Value(owner, "ColorSource") = colorSource;
Space.Unselect()
		return;
	}

if(Node.IsCamera(Node.FirstSelected())) {
var colorSource = System.CreateDO("Common Data Package/String Enum Data");
colorSource.Clear();
Node.Value(owner, "ColorSource") = colorSource;
Space.Unselect()
return;
}
Also, to the function BuildColorConnList

Code: Select all

if(connector[1]=="Border color") continue
I see, I needed to read back a page to your earlier post.

So all the extra code is because the shortcuts worked?
Nope, just the OpenPanel script
It only helps and is not full prof.
When the Color Picker is open and you in PE Mode, the Color Picker still works.
You can change the Color of the selected object in PE Mode :|
User avatar
clintonman
Captain
Posts: 5431
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Color Picker

Post by clintonman »

ColorPickerDesign02.jpg
Lots of changes under the hood for this one.

Works with normal undos so removed the special "Undo Color" button and the "Undoable" option.
Replaced the red, green, blue controls with clickable bitmaps
Added dummy sliders as indicators for the values
Removed the "Color" button, "Lum",Sat" and "Kelvin" remain.
Removed the "Kill All" testing button
Added preset colors, just 4 for now.
Improved default behavior for objects that have YafaRay materials.
Added a new option "Include Advanced" which ignores the bitmap shader block (border colors...)
Drop down list not alphabetized - makes it predictable so can have good default color selected
Works with objects that have scene instanced materials.

To save a preset push one of the S1 - S4 buttons
To use the preset click the color.

The sliders don't change anything, they just indicate the current values.

Only the luminosity mode is working. The other 2 will be added soon.

Design Note: Any changes to the size of the clickable bitmap "sliders" may need a small code change. If the built bitmap isn't proportional to the display bitmap, trueSpace will add bad values to the bottom and right edges.
Attachments
Color Picker.RsObj
(244.42 KiB) Downloaded 46 times
Clinton Reese

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

Re: Color Picker

Post by trueBlue »

Lots of great updates Clinton! :bananathumb:
Question...
Do the sliders have to be longer than the color bitmaps?
Color Picker UI.png
.
The XCoverColorPicker hides behind the main panel when you use the Pick Color Control - "Color".
User avatar
trueBlue
Captain
Posts: 5215
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Color Picker

Post by trueBlue »

The Color Pickers; S1, S2, S3, and S4 give errors.
08:15:49.345 WARN Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 1, Char: 156 Script text: Node.Value(target, conn) = color;Node.Value(owner, 'Color') = color;Node.Value(owner, 'BufferRed') = 59;Node.Value(owner, 'BufferGreen') = 148;Node.Value(owner, 'BufferBlue') = 87;Node.Value(owner, 'lum') = 0.847100019454956;;} 0x80020101 [RsScript.cpp(188)]
08:15:49.345 ERR Source object: /Scripts/CustomCommands/Color Picker/set final color Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 1, Char: 156 Script text: IMPORTANT - if the above mentioned command is accessing any function set, the error line above may refer to the function set code, instead of command code! 0x80020101 [RcScriptCmd.cpp(1170)]
User avatar
clintonman
Captain
Posts: 5431
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: 04 Feb 2023, 16:09 Lots of great updates Clinton! :bananathumb:
Question...
Do the sliders have to be longer than the color bitmaps?
Color Picker UI.png
.
The XCoverColorPicker hides behind the main panel when you use the Pick Color Control - "Color".
If the sliders are shorter then the indicator doesn't line up with the "color slider".

XCoverColorPicker fixed, thanks.
Clinton Reese

http://clintons3d.com
Post Reply