Creating custom HDR Color picker variable

Hi !

I’m trying to create a custom type in my project to be used by Visual Scripting.
I just need a HDR Color picker as VS only provide the basic color picker without HDR and I don’t know how to do it properly.

I tried to use ColorUsageAttribute in my new Type script like that :

using UnityEngine;
using UnityEditor;
using Unity.VisualScripting;

[Inspectable]
[System.Serializable]
public class ColorHDR
{
    [Inspectable]
    [ColorUsageAttribute(true, true)]
    public Color HDRColor;
}

But it looks like it is ignored by VS, I still get the normal color picker without HDR9741790--1393687--upload_2024-3-31_18-39-25.png

I’m probably missing something but i’m at loss here, any help would be welcome !

You actually need to create a Custom Inspector for the Type but the community addons has this you could use it with that.

Thanks for the answer !
By creating a Custom Inspector, you mean doing it through more classic scripting, not visual scripting right ?
Do you have a specific community addon in mind ? Not sure where to start looking just like that.

Sorry for late response yeah i mean you have to make a C# script for the inspector and this is the community addons i was talking about GitHub - RealityStop/Bolt.Addons.Community: A community-driven project for extending Unity Bolt

No problem !
Ok, I could look into making a C# script if it’s absolutely necessary. I try to keep everything working with UVS on my project.
For the addon, sadly I’m working with a 1.9 version of UVS. But I see you’re one of the maintainers on the addon, do you know if there’ll be an update supporting above 1.8 in the future ?

Yeah I am working on updating it. It should work in 1.8 but Defined events will probably not work as expected.

But if you want i can give you the script i used for the HDR Colors so you don’t need to get the addons.

Ho, that would be really nice yes !

The HDRColor inspector has to be in a Editor Folder(a folder named Editor)

9815982–1410444–HDRColor.cs (310 Bytes)
9815982–1410447–HDRColorInspector.cs (1.09 KB)

Sorry for the late reply, but thanks a lot !
That’s a really nice of you !

1 Like