Skip to main content
Participating Frequently
November 23, 2013
Question

Which layer is the target layer?

  • November 23, 2013
  • 1 reply
  • 1271 views

How can I determine which layer among those in the ->layersDescriptor structures corresponds to the target layer?

In photoshop cc x64 pc

-- all the read channel numbers seem to be unique

-- all channels have ->target=1

(edit after more work with layersDescriptor)

the information presented has a lot of errors and omissions, such that it's impossible

in principal to display layers the same way as photoshop does.  Invisible "pass through"

layers are listed as visible.  Layers with "stroke" special effects are indistinguishable

from normal layers.

This topic has been closed for replies.

1 reply

MOMIR_ZECEVIC
Inspiring
January 22, 2014

Layers with "stroke" special effects are indistinguishable

from normal layers.

Here is how to find stroke (keyFrameFX, descLayer is starting layer descriptor, in this case code also look if effects are visible)

hasKey=0;

    error = sPSActionDescriptor->HasKey(descLayer, keyLayerEffects, &hasKey);

    if (error) goto returnError;

    error = sPSActionDescriptor->GetBoolean(descLayer, keyLayerFXVisible, &effVisible);

    if (error) goto returnError;

    if (hasKey && effVisible){

            error = sPSActionControl->StringIDToTypeID("classLayerFXVisible", &runtimeClassID);

            if (error) goto returnError;

            error = sPSActionDescriptor->GetObject(descLayer, keyLayerEffects, &runtimeClassID, &descEFFECTS);

            if (error) goto returnError;

            // FRAME

            error = sPSActionDescriptor->HasKey(descEFFECTS, keyFrameFX, &hasKey);

            if (error) goto returnError;

            if (hasKey)

            {

                error = GetFrameAttributes(index, info);

            }

            //etc.

    }

Regards,

Momir Zecevic