0 Replies Latest reply on Jan 16, 2015 4:28 AM by peter@project44.be

    How to block effects being applied to plugin objects




      I am trying to block most Illustrator effects from being applied to my plugin objects (svg).


      What I have now is that a kSelectorAINotifyEdits message is received from kCallerAIPluginGroup caller, at  kCheckOperationTime or kBeforeOperationTime with a kStyleOperationCode code

      It's easy enough at that time to display a message for the user saying it is not allowed to apply filters, but it is unclear to me how to stop Illustrator from continuing to display the effect's dialog (e.g. '3d extrude & bevel options'). What I currently do is return kRefusePluginGroupReply. So that does display the effects' dialog, actually sends the style operation a 2nd time, then displays an internal error but indeed, does not apply the effect. I would like to find out if there is a more elegant solution resulting in a better user experience.

      Related, when setting the opacity of the object (also something I would like to block) , the message is only received after Illustrator has applied the opacity on the plugin object. So there, I can not even block the effect.

      I have read the documentation on kSelectorAINotifyEdits over and over again, but I just can't seem to get my head around it, I have also tried returning something else than kRefusePluginGroupReply but mostly results in the effect being applied.

      All tips more than welcome indeed!



      PS I posted this message a first time but I can't seem to find it back anymore. Might have been in the wrong forum, so apologies for a potential double post.

      Documentation of kRefusePluginGroupReply


      #define kSelectorAINotifyEdits   "AI Notify Edits"


      Notifies a plug-in group of edits to the edit group.

      An AIPluginGroupMessage::code value indicates the type of editing operation being performed. An AIPluginGroupMessage::time value indicates what stage of the operation is in progress.

      When the handler returns kNoErr, the plug-in object is marked as "dirty" (in need of kSelectorAIUpdateArt). To prevent this, return kMarkValidPluginGroupReply. If the handler returns kDontCarePluginGroupReply, retains the state of the object, and does not mark it as clean or dirty.

      If the handler returns kWantsAfterMsgPluginGroupReply from a kBeforeOperationTime notify-edits message, a single kAfterOperationTime message is sent at the end of the transaction, just before the Undo recording is closed, and before the update message. The code is kChangeOperationCode, regardless of whether a more specific code was sent at kBeforeOperationTime). This is the appropriate place to make any changes to the edit art.