Skip to main content
Participant
April 8, 2009
Answered

Stroke/Fill Style for Plugin Group Objects?

  • April 8, 2009
  • 1 reply
  • 1750 views

So I'm working on a plugin that's based on creating a PluginGroup and I started off with the Live Drop Shadow example.  So far so good, but if you want to change the stroke/fill style of the object that has the live drop shadow you have to unmake the plugin group, adjust the style on the original path and re-apply the Live Drop Shadow.   Is there a way to avoid that step?   Can I tell illustrator that this plugin group object knows about stroke style and provide a way for it to get/set the stroke/fill style of the original object directly?

For now it just makes the work flow very cumbersome, but in future as my plugin group object gets more complex and has data of it's own, it's going to be unreasonable to destroy/recreate it just to be able to adjust the line width.

   -Kurt

This topic has been closed for replies.
Correct answer A. Patterson

Ok, sorry. On further inspection it is true that I can adjust the stroke info for the path that my plugin group has subsumed.  I guess the problem I was having is that I can adjust the line width using the option menu in the stroke  tab, but the default (at the top of the screen) options available for that path no longer include the fill/stroke options.

That make sense; the control panel at the top displays items based on the selected art. Technically, plugin art has no stroke or fill since they could literally be anything.

So I start with a path, and the options at the top included fill/stroke/opacity/basic dimensions.   When I (like drop shadow) put that path under my plugin group the options at the top reduce to just the opacity and basic dimension information.   The selection text either says it's a Plugin Object (if I select the whole path) or a Path if I select just some parts of the path, but I never get the fill/stroke options.

Because I can actually adjust the stroke options without unmaking/remaking the group object (over in the stroke tab), and my plugin reacts properly I guess this issue has gone from "major issue that will make my pluin un-usable" to "minor issue that might confuse first time users, and is modestly annoying."

So I guess my question has reduced down to:  Is there a way that my plugin object can still get the stroke/fill options in that option bar at the top?  (Sorry my illustrator terminology isn't up to par... So this probably isn't the right term for that space.)

The terminology is 'control panel' I believe

As for getting stroke & fill to appear up there? Its technically possible, but you'd need to be able to talk to the control panel via the SDK - currently there is no header, unfortunately, for doing so. I think you're out of luck, at least for the moment, unless someone from Adobe can help you out. Without that there's no way to let the control panel know what it should be showing, at least as far as I know.

Right now I have no clue how to debug a plugin.  I've resorted to handing around a FILE * and fprintf'ing into that, and then looking at the file after a run.  Which is a pretty painful way to debug. :b

Debugging isn't too hard. Just make sure you point your debugger at Illustrator.exe. If you're building debug builds, after that it should respect any breakpoints you set.

I did manage to get the plugin up and functioning this morning.  (With a few bugs still in it.)    Because the debugging/development cycle for the plugin was so painfully I actually developed all the functionality for the plugin in python using pygame, and some data structs that imitate the illustrator structs.  I then did super quick iterative development in python, and then only had to translate all that into C++ and debug the few errors I introduced in the translation process.   Kind of crazy, but my machine that has Illustrator on it is pretty slow and the compile/relaunch illustrator poke though the fprintf goat entrails in my output file debugging cycle is super painful.  Not a good way to visually debug a ton of tricky math, etc.  The python trick has really made that part lots of fun.

I haven't worked with Python in a few years, but I definitely enjoyed working with it!

1 reply

A. Patterson
Inspiring
April 9, 2009

It sounds like the approach you're taking is quite right. After all, Plugin Groups are -- effectively -- custom art that you can control. Maybe you have to do it the way you're working, but typically I'd have thought you'd subsume the path art you're applied to. I know the Live Drop Shadow works differently but I think that's only because it's effectively responding to art. If you want to modify the stroke, you should probably be modifying the stroke of a path contained inside your plugin group.Unless I'm misunderstanding, and that's how it works, but it sounds like you're 'attaching' your plugin group to some other artwork.

As for disbanding & re-applying the drop shadow, I'm a little confused. You can control when & how your plugin group updates and there's certainly nothing to stop you from hanging on to an art handle and checking it for its path & stroke. If that's the way you want to operate, I don't quite know why it couldn't work just as you want. The trick would be knowing when the stroke/fill of the 'source' path has changed, because that's not something Illustrator does a great job of letting us know about. You just get generic 'something changed on the artboard, have fun figuring out what' notifiers.

If I'm not understanding, set me straight and maybe I can help. I've done a fair bit with plugin groups

Participant
April 13, 2009

Thanks for your response!

Ok, sorry. On further inspection it is true that I can adjust the stroke info for the path that my plugin group has subsumed.  I guess the problem I was having is that I can adjust the line width using the option menu in the stroke  tab, but the default (at the top of the screen) options available for that path no longer include the fill/stroke options.

So I start with a path, and the options at the top included fill/stroke/opacity/basic dimensions.   When I (like drop shadow) put that path under my plugin group the options at the top reduce to just the opacity and basic dimension information.   The selection text either says it's a Plugin Object (if I select the whole path) or a Path if I select just some parts of the path, but I never get the fill/stroke options.

Because I can actually adjust the stroke options without unmaking/remaking the group object (over in the stroke tab), and my plugin reacts properly I guess this issue has gone from "major issue that will make my pluin un-usable" to "minor issue that might confuse first time users, and is modestly annoying."

So I guess my question has reduced down to:  Is there a way that my plugin object can still get the stroke/fill options in that option bar at the top?  (Sorry my illustrator terminology isn't up to par... So this probably isn't the right term for that space.)

Right now I have no clue how to debug a plugin.  I've resorted to handing around a FILE * and fprintf'ing into that, and then looking at the file after a run.  Which is a pretty painful way to debug. :b

I did manage to get the plugin up and functioning this morning.  (With a few bugs still in it.)    Because the debugging/development cycle for the plugin was so painfully I actually developed all the functionality for the plugin in python using pygame, and some data structs that imitate the illustrator structs.  I then did super quick iterative development in python, and then only had to translate all that into C++ and debug the few errors I introduced in the translation process.   Kind of crazy, but my machine that has Illustrator on it is pretty slow and the compile/relaunch illustrator poke though the fprintf goat entrails in my output file debugging cycle is super painful.  Not a good way to visually debug a ton of tricky math, etc.  The python trick has really made that part lots of fun.

  Anyway thanks again for the quick responce!

     -Kurt

A. Patterson
A. PattersonCorrect answer
Inspiring
April 14, 2009

Ok, sorry. On further inspection it is true that I can adjust the stroke info for the path that my plugin group has subsumed.  I guess the problem I was having is that I can adjust the line width using the option menu in the stroke  tab, but the default (at the top of the screen) options available for that path no longer include the fill/stroke options.

That make sense; the control panel at the top displays items based on the selected art. Technically, plugin art has no stroke or fill since they could literally be anything.

So I start with a path, and the options at the top included fill/stroke/opacity/basic dimensions.   When I (like drop shadow) put that path under my plugin group the options at the top reduce to just the opacity and basic dimension information.   The selection text either says it's a Plugin Object (if I select the whole path) or a Path if I select just some parts of the path, but I never get the fill/stroke options.

Because I can actually adjust the stroke options without unmaking/remaking the group object (over in the stroke tab), and my plugin reacts properly I guess this issue has gone from "major issue that will make my pluin un-usable" to "minor issue that might confuse first time users, and is modestly annoying."

So I guess my question has reduced down to:  Is there a way that my plugin object can still get the stroke/fill options in that option bar at the top?  (Sorry my illustrator terminology isn't up to par... So this probably isn't the right term for that space.)

The terminology is 'control panel' I believe

As for getting stroke & fill to appear up there? Its technically possible, but you'd need to be able to talk to the control panel via the SDK - currently there is no header, unfortunately, for doing so. I think you're out of luck, at least for the moment, unless someone from Adobe can help you out. Without that there's no way to let the control panel know what it should be showing, at least as far as I know.

Right now I have no clue how to debug a plugin.  I've resorted to handing around a FILE * and fprintf'ing into that, and then looking at the file after a run.  Which is a pretty painful way to debug. :b

Debugging isn't too hard. Just make sure you point your debugger at Illustrator.exe. If you're building debug builds, after that it should respect any breakpoints you set.

I did manage to get the plugin up and functioning this morning.  (With a few bugs still in it.)    Because the debugging/development cycle for the plugin was so painfully I actually developed all the functionality for the plugin in python using pygame, and some data structs that imitate the illustrator structs.  I then did super quick iterative development in python, and then only had to translate all that into C++ and debug the few errors I introduced in the translation process.   Kind of crazy, but my machine that has Illustrator on it is pretty slow and the compile/relaunch illustrator poke though the fprintf goat entrails in my output file debugging cycle is super painful.  Not a good way to visually debug a ton of tricky math, etc.  The python trick has really made that part lots of fun.

I haven't worked with Python in a few years, but I definitely enjoyed working with it!