Jump to content

CodeLab v6.0 (for advanced users) Released June 25, 2020


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. ;)

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
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
Link to post
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

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites
  • 2 weeks later...

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 post
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.*")]
Link to post
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.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
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 post
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.

Link to post
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
Link to post
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

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
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

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
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 post
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.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites

CodeLab 2.14 Released

This is only for Paint.NET 4.0.9+!

Tiny little update today...

Changes:

▪ Fixed a bug in the new Double Vector default code. (Reported by ReMake)

 

Grab the CodeLab DLL here:

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

  • Upvote 1

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites
  • 3 weeks later...
  • BoltBait changed the title to CodeLab v6.0 (for advanced users) Released June 25, 2020

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...