Tuesday, March 23, 2010

How to add a new layer in Format Plugin?

How to add a new layer in Format Plugin? And make it active.
How to add a new layer in Format Plugin?
You cannot make a multiple layered document via a file format plug-in. Your only option is to use a combination of an automation plug-in and a file format plug-in. See the text example in the SDK under file format examples.
How to add a new layer in Format Plugin?
Seems to me I don't understand something, or text format plugin isn't quite well example. But, I got some code from sdk to create layer with automation like this:



SPErr MakeLayer(void) {

PIActionDescriptor descriptor = NULL;

PIActionReference reference = NULL;

PIActionDescriptor result = NULL;

SPErr error = kSPNoError;

error = sPSActionDescriptor-%26gt;Make(%26amp;descriptor);

if (error)

goto returnError;

// Move this to the top of the routine!

error = sPSActionReference-%26gt;Make(%26amp;reference);

if (error)

goto returnError;

error = sPSActionReference-%26gt;PutClass(reference, classLayer);

if (error)

goto returnError;

error = sPSActionDescriptor-%26gt;PutReference(descriptor, keyNull, reference);

if (error)

goto returnError;

error = sPSActionControl-%26gt;Play(%26amp;result, eventMake, descriptor,

plugInDialogSilent);

if (error)

goto returnError;



returnError:

if (result != NULL) sPSActionDescriptor-%26gt;Free(result);

if (descriptor != NULL) sPSActionDescriptor-%26gt;Free(descriptor);

if (reference != NULL) sPSActionReference-%26gt;Free(reference);

return error;

}



and wrote aeta resource:

resource 'aete' (16000, ''myFile'' '' dictionary'', purgeable)

{

1, 0, english, roman,

{

vendorName,

''description'',

plugInClassID,

1,

1,

{

vendorName '' myFormat'',

plugInAETEComment,

plugInClassID,

plugInEventID,



NO_REPLY,

IMAGE_DIRECT_PARAMETER,

{

''create'',

keyMyCreate,

typeMyCreate,

''create type'',

flagsEnumeratedParameter

},

},

{},

{},

{

typeMyCreate,

{

''layer'',

createLayer,

''make layer''

}

}

}

};

And what now? Is any better examples?

using SPErr MakeLayer(void) directly from DoReadContinue() for example make PS crashing.

How to add a new spotcolor channel in a filterplugin an how to make it aktive

No comments:

Post a Comment