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.
Is this a problem with the SDK or this is expected?
Souldn't just Layer 1 be the only layer?
Thanks,
Hitesh
Copy link to clipboard
Copied
Expected, you're seeing the structure of the group.
Copy link to clipboard
Copied
What is the significance of </Layer Group>? Is this indeed a Layer?
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?
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);
Copy link to clipboard
Copied
Thanks a ton for this details information. I'll try this out.
Thanks,
Hitesh