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

Rotate command not currently available

New Here ,
May 24, 2010 May 24, 2010

Copy link to clipboard

Copied

I am creating an automation plug-in that needs to rotate the image. Here is the code to call the eventRotate command:

{

PIActionDescriptor rotation_desc;

sPSActionDescriptor->Make(&rotation_desc)

double degrees = 15;

SPErr rotate_error = sPSActionDescriptor->PutUnitFloat(rotation_desc, keyAngle, unitAngle, degrees); // No error here.

rotate_error = sPSActionControl->Play(&result, eventRotate, rotation_desc, plugInDialogSilent); // Returns error -25920.

if (rotate_error != 0)
display error message
}
The result of the Play call is a rotate_error of -25920, (The command "Rotate" is not currently available.)
Changing plugInDialogSilent to plugInDialogDisplay produces the same user interaction as choosing Image->Rotate Canvas->Arbitrary… from the menu, except that it then fails with error -25920.
How do I rotate an image from an automation plug-in?

TOPICS
SDK

Views

2.3K

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

Adobe Employee , May 25, 2010 May 25, 2010

Here is what Listener outputs for me and works on CS5. Your code failed for me so please check out this block of code.

SPErr PlayeventRotate(/*your parameters go here*/void)

{

PIActionDescriptor result = NULL;

DescriptorTypeID runtimeKeyID;

DescriptorTypeID runtimeTypeID;

DescriptorTypeID runtimeObjID;

DescriptorTypeID runtimeEnumID;

DescriptorTypeID runtimeClassID;

DescriptorTypeID runtimePropID;

DescriptorTypeID runtimeUnitID;

SPErr error = kSPNoError;

// Move this to the top of the routine!

PIActionDescri

...

Votes

Translate

Translate
Adobe
Adobe Employee ,
May 25, 2010 May 25, 2010

Copy link to clipboard

Copied

LATEST

Here is what Listener outputs for me and works on CS5. Your code failed for me so please check out this block of code.

SPErr PlayeventRotate(/*your parameters go here*/void)

{

PIActionDescriptor result = NULL;

DescriptorTypeID runtimeKeyID;

DescriptorTypeID runtimeTypeID;

DescriptorTypeID runtimeObjID;

DescriptorTypeID runtimeEnumID;

DescriptorTypeID runtimeClassID;

DescriptorTypeID runtimePropID;

DescriptorTypeID runtimeUnitID;

SPErr error = kSPNoError;

// Move this to the top of the routine!

PIActionDescriptor desc0000000000000120 = NULL;

error = sPSActionDescriptor->Make(&desc0000000000000120);

if (error) goto returnError;

// Move this to the top of the routine!

PIActionReference ref0000000000000038 = NULL;

error = sPSActionReference->Make(&ref0000000000000038);

if (error) goto returnError;

error = sPSActionReference->PutEnumerated(ref0000000000000038, classDocument, typeOrdinal, enumFirst);

if (error) goto returnError;

error = sPSActionDescriptor->PutReference(desc0000000000000120, keyNull, ref0000000000000038);

if (error) goto returnError;

error = sPSActionDescriptor->PutUnitFloat(desc0000000000000120, keyAngle, unitAngle, 33);

if (error) goto returnError;

error = sPSActionControl->Play(&result, eventRotate, desc0000000000000120, plugInDialogSilent);

if (error) goto returnError;

returnError:

if (result != NULL) sPSActionDescriptor->Free(result);

if (desc0000000000000120 != NULL) sPSActionDescriptor->Free(desc0000000000000120);

if (ref0000000000000038 != NULL) sPSActionReference->Free(ref0000000000000038);

return error;

}

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