• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can a script change a layer's opacity without affecting history state?

New Here ,
Oct 13, 2013 Oct 13, 2013

Copy link to clipboard

Copied

I'm automating Photoshop and have implemented a simple feature that involves fading the top layer of the active document in and out, repeatedly by changing its opacity from a timer's tick event.

The key bit of code that I use to change a layer's opacity is:

ActiveDocument.ArtLayers(layer).Opacity = opacity

This works well except that it fills the history with opacity state changes.

Is there a way to avoid having the opacity change step recorded in the history or a way to remove the last step recorded?

Thanks.

TOPICS
Actions and scripting

Views

1.8K

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
Adobe
Community Expert ,
Oct 13, 2013 Oct 13, 2013

Copy link to clipboard

Copied

I'm not sure why you want to repeatly turn the opacity on and off, but if you don't want your history staty filled, why don't you record a snapshot of your history state then when you're done, go back to that state, or which ever state you want to finish on?

Votes

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
Guru ,
Oct 14, 2013 Oct 14, 2013

Copy link to clipboard

Copied

A snapshot will still fill the history with a lot of opacity changes( and wipe out any of the user's history ).

Your code looks like some flavor of VB. I don't know if it is available there but javascript has a suspendHistory method. That would limit the historyStates created by the script to one. And that assumes the opacity changes are being made during one running of the script. If the timer is running the script multiple times I don't think there is any thing you to do to save the history except dupe the document and make the changes on the dupe.

Votes

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
New Here ,
Oct 14, 2013 Oct 14, 2013

Copy link to clipboard

Copied

LATEST

Thanks. It is vb.net using the photoshop interop dll. There doesn't appear to be a suspendHistory property for the Photoshop.Document object. Oh well.

Votes

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