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

Automation Filter Sample with Groups and Layer

Explorer ,
Dec 15, 2010 Dec 15, 2010

Copy link to clipboard

Copied

Hello,

I have a file with 1 Group (Group 1). This group contains one layer (Layer 1).

While using the AutomationFilter Plugin from sample project in SDK, number of layers is given 3 with the Layer names: </Layer group>, Group 1, Layer 1.

Group&Layer.jpg

Is this a problem with the SDK or this is expected?

Souldn't just Layer 1 be the only layer?

Thanks,

Hitesh

TOPICS
SDK

Views

1.2K

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
Dec 16, 2010 Dec 16, 2010

Copy link to clipboard

Copied

Expected, you're seeing the structure of the group.

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
Explorer ,
Dec 16, 2010 Dec 16, 2010

Copy link to clipboard

Copied

What is the significance of </Layer Group>? Is this indeed a Layer?

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
Explorer ,
Dec 16, 2010 Dec 16, 2010

Copy link to clipboard

Copied

Also, in the structure, how can I differentiate between a layer and group?

Does the PSActionDescriptor provide this information? Which key should be used?

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
Adobe Employee ,
Dec 17, 2010 Dec 17, 2010

Copy link to clipboard

Copied

Getter is your friend. Install that plug-in and run it via File > Automate

> Getter

This plug-in dumps all the keys from application/layer/channel and tells you what is available when asking Photoshop.

For your question the

PlayGetting Layer Info

section shows

error = sPSActionDescriptor->PutString(desc0000000000000578, keyName, "</Layer group>");

error = sPSActionDescriptor->PutString(desc0000000000000590, keyName, "Layer 1");

error = sPSActionDescriptor->PutString(desc00000000000005A8, keyName, "Group 1");

for the three layers you are seeing in that dialog (note the dialog needs to get fixed to not show group layers!) and has major problems when trying to use the other buttons when a layer group is selected!

The layer stack is upside down when looking at it sequentially in the getter.log file. You will first find these keys for the </Layer group> entry.

error = sPSActionControl->StringIDToTypeID("layerSection", &runtimeKeyID);

if (error) goto returnError;

error = sPSActionControl->StringIDToTypeID("layerSectionEnd", &runtimeEnumID);

if (error) goto returnError;

error = sPSActionControl->StringIDToTypeID("layerSectionType", &runtimeTypeID);

if (error) goto returnError;

error = sPSActionDescriptor->PutEnumerated(desc0000000000000578, runtimeKeyID, runtimeTypeID, runtimeEnumID);

if (error) goto returnError;

You will see this for the "Layer 1" entry

error = sPSActionControl->StringIDToTypeID("layerSection", &runtimeKeyID);

if (error) goto returnError;

error = sPSActionControl->StringIDToTypeID("layerSectionContent", &runtimeEnumID);

if (error) goto returnError;

error = sPSActionControl->StringIDToTypeID("layerSectionType", &runtimeTypeID);

if (error) goto returnError;

error = sPSActionDescriptor->PutEnumerated(desc0000000000000590, runtimeKeyID, runtimeTypeID, runtimeEnumID);

if (error) goto returnError;

And then the the "Group 1" entry

error = sPSActionControl->StringIDToTypeID("layerSection", &runtimeKeyID);

if (error) goto returnError;

error = sPSActionControl->StringIDToTypeID("layerSectionStart", &runtimeEnumID);

if (error) goto returnError;

error = sPSActionControl->StringIDToTypeID("layerSectionType", &runtimeTypeID);

if (error) goto returnError;

error = sPSActionDescriptor->PutEnumerated(desc00000000000005A8, runtimeKeyID, runtimeTypeID, runtimeEnumID);

if (error) goto returnError;

Another interesting key on a layer is keyText. This will tell you that you are on a text layer and you can get information about the text on that layer by inspecting the descriptor found in that key. This key is not present on the "Layer 1" dump from above.

error = sPSActionDescriptor->PutObject(desc0000000000000E70, keyText, classTextLayer, desc0000000000000E78);

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
Explorer ,
Dec 19, 2010 Dec 19, 2010

Copy link to clipboard

Copied

LATEST

Thanks a ton for this details information. I'll try this out.

Thanks,

Hitesh

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