Creating a layer in a document using "constants" "LayerKind.COLORBALANCE" does not work

Dear all,
I have looked in the forum, but most use autobatch to create / adjust live a colorbalance layer. I just want to create a layer set with a certain value, for each iteration.
Using the same layer and adjust it was not yet planned, maybe I can find a way to do it in the future, but my question is about creating one.

I tried to create it using the COLORBALANCE version, but apparently I made a mistake.

let colorBalanceLayer = await document.createLayer(
constants.LayerKind.COLORBALANCE, // Create a color balance layer
{ name: “ColorBalanceRED_CYAN”, opacity: 100, blendMode: constants.BlendMode.NORMAL }
)
does not yield the expected result but instead triggered an error.

main.js:2973 Error: Unknown kind colorBalance somehow passed validation.

Hopefully I just made a trivial error.

Thank you for any tips on this matter!
Cheers,
Oliver

I have found a post that shows the kind of a layer as a number:

I have run into this issue a few times and typically I think this particular constant just hasn’t been implemented yet. I think there is a similar issue with blend modes, where only a few of the constants are actually implemented in the API even though they are all listed in the type defs. You may have to resort to batchplay or actions for now.

1 Like

Hi Josh,

thank you for your reply!
I will try to do the batch play (wanted to leave it out if I could, but apparently there are some things that just cannot be done ;D).

Cheers,
Oliver

1 Like

One list of constants might have multiple use cases. For example, if you ask for a layer kind, you could get this one. But as you say, it is not implemented for layer creation. DOM is very limited.

1 Like

Thank you Jarda, for adding your knowledge to the information.
Do you know if there are plans to implement it? The current way to use Batchplay is an option, but for the future it would be great to have a more “simple” “straightforward” way :).

Cheers,
Oliver

P.S. Is currently Batchplay the only way to create a adjustment layer with the Colorbalance property?

When I had contract with Adobe me and Davide contributed into DOM. And there are no new DOM features since contract expired. And I am not aware of any plans to add more DOM. I think Adobe has different priorities now and for reasons unknown to me they don’t hire additional workforce.

I was thinking of making a separated DOM driven fully by us… a third party, It is certainly possible, but that would take hundreds/thousands of hours to make right. So I would need to figure out funding.

3 Likes

Wow, thank you Jarda for the deep dive, this is not surprising to read, considering the state of the API, but it is always quite refreshing to read it written out.
Have you been in talks with any party who is specialised in open source like the guys from the Blender foundation?

Thank you for taking your time to answer my question!

Cheers,
Oliver

I was thinking about some similar to licensing how Unity or Unreal Engine are done. Free for non-profit projects. Small fee for freelancers and big fee for big corporations. If that would work out well it would allow me spend unlimited time on that DOM and make it really great. Another idea would more like Kickstarter… deliver certain feature per certain goal reached and then make it open-sourced for everyone. But there are risks involved and I can have good risk-free work at the same time.

I don’t think that Blender foundation should spend money on something where main beneficiary is big corporation with billions of net profit.

Adobe has Fund for Design and it helped to some of the community projects for us devs. It really made a difference. The thing is, priorities changed and there does not seem to be a will spend money on PS DOM.

2 Likes

TBH for me it feels like Ps team completely forgot UXP since AI BS hit the fan :disappointed_face: There are so so many issues lasting for years and with every release there were new ones introduced, but there were no fixes at all for months now

I understand! I was also thinking of something like a Kickstarter or Free / non-free model, I was thinking that they made a great start with the blender foundation, not that they should sponsor you, but maybe as a networking / exchange of experience.
In the end everyone who works with Photoshop will benefit, but then again, Adobe should have the pockets full of cash ;).

Cheers!
Oliver

1 Like

Maybe you are right, I am not knowledgeable enough, but I am surprised how the API and the reality can be divergent to this point.
I am very glad that there are senior experts in the forum willing to help me find my way through this, as without the support that I have received so far, it would not have been possible to get to a working plugin, just by reading the API and the code snippets that I found.

Thank you also for your support here!
Cheers,
Oliver

I think layer masks were implemented in Photoshop in last century but today there is still no way to add layer mask via DOM API.

Btw PS docs gets update today. Updated by Sam. src/pages/ps_reference/changelog/index.md

2 Likes

Thank you!
How can I read only the updated part (I looked at the changelog, but I did not see an option to open the part in the docs to see the updated part nicely, only the part in the changelog itself).

Cheers,
Oliver

It is already here: https://developer.adobe.com/photoshop/uxp/2022/ps_reference/changelog/

1 Like

Thank you Jarda for the clarification.
I am sure I will find my way around in time!

Cheers,
Oliver :slight_smile: