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?