P: Layer effects scripting - 10 bugs - AM code

5 Votes
LEGEND ,
May 28, 2017 May 28, 2017

Copy link to clipboard

Copied

I worked on script for removing unused effects. Instead I found total chaos. I found 10 bugs and I found that is impossible to do script which will work correctly.

Here is list of sh*ts

  1. you can't remove layer style/effect if app.doForcedProgress() dialog is shown
  2. you can't remove e.g. second drop-shadow from three even if script listener records code with list item index... it always removes first
  3. you can't use code for removing style/single-effect if all effects are disabled or main visibility is disabled. In photoshop you can do it, but recorded code in script listener doesn't works
  4. if I clear style with drag and drop fx icon to recycle bin, it removes style and keep blending options... but code recorded in script listener doesn't
  5. there is no posibility read options if mask hides effects... so if you read descriptor, change values and set descriptor, it always reset these settings to default values
  6. action "paste layer effect and keep advanced blending" is incorectly recorded in script listener
  7. if you remove multiple dropshadow effects and last dropshadow remaining you can't remove it with AM code. (It's no longer list of shadows but single shadow.)
  8. same situation from point 7 is in case that you want/show hide effect
  9. using modified descriptor for removing style has same bug as point 3. ...you just can't set "enabled=false" and "present=false" for all effects
  10. show/hide all effects doesn't works whole style visibility is disabled... there are three states of visibility icon. "white - Visible", "grayed - hidden", "invisible - hidden"

And some other bugs I don't remeber now.

I tried to read style descriptor, modify apply
> I can't beacause bugs: 5, 3

I tried to remove effects one by one
> I can't bugs 2
So I did some sorting if there is multiple effects of same kind and layer visibility changes
> Doesn't works - bugs 7,8,3

logged: bug ID: PS-9050

Bug Fixed
TOPICS
macOS , Windows

Views

39

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 24, 2018 Jan 24, 2018
I think some of these bugs were fixed in CC2018.1 looks like 2, 4 are fixed. And I quickly tried some other but looks like no improvement, but I didn't tested all with precisely.

Votes

Translate

Translate
11 Comments
LEGEND ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

Seems to that I finally found something what maybe is not messed up. I can create empty layer and move whole style or partial effect to new layer and then delete it. If empty layer already has style then whole styles are replaced with new. Single effects are replaced. Multi effect are added to existing and has limit of 10 effects.

1) it doesn't reset advanced blending
2) I can pick which e.g. drop shadow I want by specific index
3) Looks like doesn't matter if whole style or partial effects are visible

Votes

Translate

Translate

Report

Report
Participant ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

So you are saying that you can do something like:

- Have a styled layer with fx and a drop shadow.
- Create new empty layer
- Create drop shadows on new empty layer
- "Move" drop-shadow #2 onto previous layer
- End up with original layer having 2 drop shadows

or is it more like?
- Have styled layer
- create new empty layer
- move whole style onto new layer
- move individual style components back to original layer

Votes

Translate

Translate

Report

Report
LEGEND ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

If you want remove unused style and effects you have two cases:
1) you want remove whole style
2) you want remove one effect from style

So you can
1)
a) create new empty layer without effects and style
b) move style from current layer to new layer. So you removed whole style from current layer
c) repeat for another layer or remove empty layer

2)
a) create new empty layer without effects and styles
b) move single effect of style from current layer to new empty layer. So you removed single effect from current layer style
c) repeat for another effect in style or another layer or you can remove new empty layer itself. Make sure that there is less than 10 multi-effects if you want move effect

But it's not yet properly tested.

---
What you wrote could work. But it depends what you want to keep. Moving whole style replace all effects in both layers.

Votes

Translate

Translate

Report

Report
LEGEND ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

Anyway if style has zero effects or all effects has boolean property present=false then whole style is removed. So you can remove partial effects until there are some and finaly whole style is removed. But it takes more time. Something about 30-40ms per effect.

Votes

Translate

Translate

Report

Report
Participant ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

Thank you for the clarification! I'm sure it will save me and others a lot of headache till this can get sorted out.

Votes

Translate

Translate

Report

Report
LEGEND ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

Maybe they will be saved from pain if they decide just don't do anything advanced with effects or don't care about zero bug tolerance. Otherwise... good luck they will need it a lot 😄

Votes

Translate

Translate

Report

Report
LEGEND ,
Jun 05, 2017 Jun 05, 2017

Copy link to clipboard

Copied

bug #11 - you can move style/effect even if layer is locked.

Normally you can't do it. 
Simplest thing how to verify this is recording action without locks and then lock layers and run action.

Votes

Translate

Translate

Report

Report
LEGEND ,
Jun 05, 2017 Jun 05, 2017

Copy link to clipboard

Copied

Max: my theory was confirmed. Script works as I said. http://bereza.cz/ps/ (Clear hidden effects 1.1 )

It's slower than version 1.0 but it seems to be bulletproof from CS6 to CC2017

Votes

Translate

Translate

Report

Report
Participant ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

Any idea if some of these were fixed in 2018? 

Votes

Translate

Translate

Report

Report
LEGEND ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

Logged bug ID: PS-9050 has same untouched state since it's creation. So I don't think it's fixed. I will test it in next weeks/months.

Votes

Translate

Translate

Report

Report
LEGEND ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

LATEST
I think some of these bugs were fixed in CC2018.1

looks like 2, 4 are fixed. And I quickly tried some other but looks like no improvement, but I didn't tested all with precisely.

Votes

Translate

Translate

Report

Report