MJW Posted October 22, 2013 Share Posted October 22, 2013 I'm intrigued by the idea of plugins that call another effect, as discussed in BoltBait's tutorial on complex plugins. Can only built-in effects be called, or can user-written plugins also be called? I suspect it's only the built-in effects, but if not, can the effects be chained, so an effect can call an effect that also calls an effect? On a related note, which adjustments can be called as single-pixel operations? Is it limited to the built-in adjustments? Quote Link to comment Share on other sites More sharing options...
MJW Posted October 22, 2013 Author Share Posted October 22, 2013 Also, is there a way to edit the title of a post? I put one too many l's in "called." Quote Link to comment Share on other sites More sharing options...
BoltBait Posted October 22, 2013 Share Posted October 22, 2013 To answer your questions: 1) You can call any installed effect in the same way you can call the built-in effects. 2) You can chain the effects together, but as I said in the tutorial... you only have 2 surfaces to work with (the source canvas and the destination canvas). If you want more, you need to create them yourself. This is not impossible. Just be careful you don't run out of memory. 3) You may run as many single-pixel operations as you like. You can also call as many blending operations as you like. An example of calling external plugins can be found in this plugin: http://forums.getpaint.net/index.php?/topic/6091-scriptlab/ Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted October 22, 2013 Author Share Posted October 22, 2013 Many thanks, BoltBait. I'l surprised, and pleased, that user-written plugins can be called that way. Quote Link to comment Share on other sites More sharing options...
MJW Posted October 22, 2013 Author Share Posted October 22, 2013 I have another question. Does a user plugin have to do something to allow the control parameters to be changed? Internally, the control variables for CodeLab plugins are called Amount#, and the only other reference to them is the label assigned in the user interface, assuming IndirectUI is used. So how can they be set by the calling plugin? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted October 22, 2013 Share Posted October 22, 2013 I have another question. Does a user plugin have to do something to allow the control parameters to be changed? Internally, the control variables for CodeLab plugins are called Amount#, and the only other reference to them is the label assigned in the user interface, assuming IndirectUI is used. So how can they be set by the calling plugin? Look at http://www.boltbait.com/pdn/CodeLab/help/tutorial3.asp In the first section, it explains how to pass parameters to the called functions. Look at the code samples where there is a "//fix" comment. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted October 23, 2013 Author Share Posted October 23, 2013 (edited) Thank you. I had read that tutorial, but somehow managed to miss that part. Edit: Wait. Now I see why I was confused, though by looking at some compiled CodeLab code, my question is answered. The code for Gaussian blur is GaussianBlurEffect blurEffect = new GaussianBlurEffect();PropertyCollection bProps = blurEffect.CreatePropertyCollection();PropertyBasedEffectConfigToken bParameters = new PropertyBasedEffectConfigToken(bProps);bParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1); // fixblurEffect.SetRenderInfo(bParameters, new RenderArgs(dst), new RenderArgs(src));// Call Gaussian BlurblurEffect.Render(new Rectangle[1] {rect},0,1); The part that sets the Radius is: bParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1); I didn't see how the name "Radius" got associated with a value in the Gaussian blur plugin. Looking at the compiled code, I see the Amount# variable names are listed in an enumeration called PropertyNames. So now I can see that the Amount# names are what are used in the call. Edited October 23, 2013 by MJW Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.