Jump to content
How to Install Plugins ×

CodeLab v6.12 for Paint.NET 5.0.12 (Updated February 11, 2024)


Rick Brewster

Recommended Posts

Building to DLL works for me.

Did you follow the instructions and save your source file first? If so, do you see the source name in the CodeLab title bar? When you see that, does it still fail to build?

If not, is there some reason why CodeLab can't write to your desktop?

Are there illegal characters in the source filename. Try A-Z only and see if it builds then.

Did you name your effect Untitled.cs? That's not gonna work. ;)

Link to comment
Share on other sites

In the next version, can you please add 'System.Drawing.Drawing2D' to the list of assemblies in the prepended script?

I get tired having to type it out (or paste it) every time I want to use 'SmoothingMode' or 'DashStyle', ect.

I've already patched my local copy, my script won't with other people's CodeLab copy.

  • Upvote 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

I'll look and see if it causes any collisions.

 

EDIT: I just checked and it shouldn't be a problem.  I'll add it to the next release.

 

 

In the next version, can you please add 'System.Drawing.Drawing2D' to the list of assemblies in the prepended script?

You actually have to add it in 2 places: prepend_a variable and the Build() function.

  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...

Are you willing to change the range for the first Version numBox to allow '0'?

 

versionBox.png

 

Sometimes I type: " // Version: 0.9 " in the editor, and when I go to build the dll, paint.net crashes. :(

  • Upvote 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

I've played with this in VS just today. It told me that the Version requires integers, and only integers. But you can have four of them!

 

I'm not sure you're going to get away with "0.9".

Link to comment
Share on other sites

I've played with this in VS just today. It told me that the Version requires integers, and only integers. But you can have four of them!

 

I'm not sure you're going to get away with "0.9".

You mean in 'AssemblyVersion'?

I do this all the time, and it works without issue:

[assembly: AssemblyVersion("0.9.0.0")]
This also works without issue:

[assembly: AssemblyVersion("0.9.*")]

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

CodeLab specifically uses this form:

This also works without issue:

[assembly: AssemblyVersion("0.9.*")]

The reason is simple, using the "*" makes the compiler fill in the last two groups of numbers automatically based on when you do the build. This keeps your individual builds of effects unique. That way, if Rick ever needs to block a single build of your plugin, it will be possible.

Link to comment
Share on other sites

You mean in 'AssemblyVersion'?

I do this all the time, and it works without issue:

[assembly: AssemblyVersion("0.9.0.0")]

Senior moment :( I mistakenly thought you wanted to type in "0.9" where an integer was required.

This also works without issue:

[assembly: AssemblyVersion("0.9.*")]

It does.

Personally I don't like the five digit int returned by Version.Revision. I tried dividing by 10. It worked fine in the UI title bar, but PluginSupportInfo still showed five digits. In the end I reverted to five digits in the UI title bar.

Link to comment
Share on other sites

Now that CodeLab is using 'PanSliderControl', how about an option to set the default values for the Pan/DoubleVector control? Seems silly to have to migrate a script into Visual Studio just to change defaults.

The Min and Max could probably stay hard coded.

Same goes for the default values of the 3D Roll Ball control.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Could we have an option in CodeLab to use 'String.Empty' in the 'ControlInfoPropertyNames.DisplayName' ?
 

Edit: Nevermind. It's already there. Could of sworn it wasn't working when I tried before. This is what happens when I stay up too late at night.

Edited by toe_head2001

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

  • 3 weeks later...

CodeLab 2.12 Released

This is only for Paint.NET 4.0.9+!

Just a small update today...

Changes:

▪ Added System.Drawing.Drawing2D to the included assemblies.

▪ Script versions can now start with a 0, as in Version 0.1

▪ When using the editor with word wrap enabled, you'll see indicators if the lines wrapped.

 

Grab the CodeLab DLL here:

http://www.boltbait.com/pdn/CodeLab/

  • Upvote 4
Link to comment
Share on other sites

  • 1 month later...

CodeLab 2.13 Released

This is only for Paint.NET 4.0.9+!

Another small update today...

Changes:

▪ Added auto updater. (Probably should have added this first... ;) )

▪ Colorwheel controls can have specified defaulted colors.

▪ Double Vector controls can now have defaults.

 

Grab the CodeLab DLL here:

http://www.boltbait.com/pdn/CodeLab/

Details

In the past, the first color wheel control always defaulted to the currently selected primary color and the second (and beyond) color wheel control defaulted to the currently selected secondary color.

Now, you can specify defaults for the color wheel controls. Here is an example:

// Name: Drop Shadow Demo
// Submenu: Object
// Author: BoltBait
// Title: Drop Shadow Demo
// Version: 0.1
// Desc: Drop Shadow
// Keywords: drop|shadow
// URL: http://www.BoltBait.com/pdn
// Help:
#region UICode
IntSliderControl Amount1 = 4; // [0,100] Radius
PanSliderControl Amount2 = Pair.Create( 0.020 , 0.020 ); // Shadow Offset
ColorWheelControl Amount3 = ColorBgra.FromBgr(0,0,0); // [Black] Shadow Color
DoubleSliderControl Amount4 = 0.5; // [0,1] Shadow Strength
#endregion

// Working surface
Surface wrk = null;

// Setup for using Normal blend op
private BinaryPixelOp normalOp = LayerBlendModeUtil.CreateCompositionOp(LayerBlendMode.Normal);

// Here is the main render loop function
void Render(Surface dst, Surface src, Rectangle rect)
{
    // offset the src canvas onto the wrk canvas
    if (wrk == null)
    {
        ColorBgra ShadowColor = Amount3;
        wrk = new Surface(src.Size);
        for (int y=0; y < src.Size.Height; y++)
        {
            for (int x=0; x < src.Size.Width; x++)
            {
                wrk[x,y] = src.GetBilinearSample((float)(x-Amount2.First*100),(float)(y-Amount2.Second*100));
                ShadowColor.A = (byte)(wrk[x,y].A * Amount4);
                wrk[x,y] = ShadowColor;
            }
        }
    }
    // Setup for calling the Gaussian Blur effect
    GaussianBlurEffect blurEffect = new GaussianBlurEffect();
    PropertyCollection blurProps = blurEffect.CreatePropertyCollection();
    PropertyBasedEffectConfigToken BlurParameters = new PropertyBasedEffectConfigToken(blurProps);
    BlurParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1);
    blurEffect.SetRenderInfo(BlurParameters, new RenderArgs(dst), new RenderArgs(wrk));
    // Call the Gaussian Blur function
    blurEffect.Render(new Rectangle[1] {rect},0,1);

    // Now in the main render loop, the dst canvas has a blurred version of the wrk canvas
    for (int y = rect.Top; y < rect.Bottom; y++)
    {
        if (IsCancelRequested) return;
        for (int x = rect.Left; x < rect.Right; x++)
        {
            ColorBgra CurrentPixel = dst[x,y];

            CurrentPixel = normalOp.Apply(CurrentPixel,src[x,y]);

            dst[x,y] = CurrentPixel;
        }
    }
}
The color wheel default comes from the color word in brackets in the comment, not from the color specified in the Bgr call.

Notice that when the code is built, the PanSliderControl also uses the specified values as the defaults.

  • Upvote 6
Link to comment
Share on other sites

Changes:

▪ Added auto updater. (Probably should have added this first... ;) )

▪ Colorwheel controls can have specified defaulted colors.

▪ Double Vector controls can now have defaults.

Many thanks BoltBait!

Link to comment
Share on other sites

Those are some very useful features!

 

I assume (or at least hope) that the first and second Color Wheel control will still default to the Primary and Secondary color if left unspecified.

Link to comment
Share on other sites

If there's high network latency, the web request to the update txt can prevent the GUI from appearing for several seconds when the plugin is opened.

 

It would probably be better to use the OpenReadAsync() method instead.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Those are some very useful features!

 

I assume (or at least hope) that the first and second Color Wheel control will still default to the Primary and Secondary color if left unspecified.

Older scripts work just as before. It would be best if you played around with the User Interface Designer (Ctrl-I) to see how the color wheel controls work now.

If there's high network latency, the web request to the update txt can prevent the GUI from appearing for several seconds when the plugin is opened.

 

It would probably be better to use the OpenReadAsync() method instead.

I may refine the code in the next update. In the meantime, if you don't like it, just turn it off in the Help menu.

Link to comment
Share on other sites

CodeLab 2.13 in Russian

 

You can find the new version of CodeLab in Russian here.

Вы можете найти новую версию CodeLab на русском языке здесь.

Link to comment
Share on other sites

CodeLab 2.14 in Russian

 

You can find the new version of CodeLab in Russian here.

Вы можете найти новую версию CodeLab на русском языке здесь.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...