Rick Brewster

CodeLab v4.2 (for advanced users) Released March 18, 2019

Recommended Posts

I said 'useful' in miniquotes because anybody who knows how to program will laugh at me. It is Alpha Inversion. Just a quick play around with CodeLab, working on other things right now.

Share this post


Link to post
Share on other sites

Alright, I cannot get any files to build as a .DLL. I keep getting errors about lines 80-100 on my 30 line plugin :?

Edit: doesnt matter, my plugin was simple so I just rewrote it.

Share this post


Link to post
Share on other sites

BoltBait, File->Save as DLL doesn't give you a chance to change the name before it freaks out and informs you that X.dll already exists. Having to save the source before being able to change the name of anything is really... tacky.

Share this post


Link to post
Share on other sites
BoltBait, File->Save as DLL doesn't give you a chance to change the name before it freaks out and informs you that X.dll already exists. Having to save the source before being able to change the name of anything is really... tacky.

Where were you before release?

See, now, that's the sort of feedback that I rely on my beta testers to provide IN A TIMELY MANNER!!! :roll:

(In other words, tough!)

Share this post


Link to post
Share on other sites

Alright, I have a suggestion: stop going straight to the directory Paint.NET last opened when opening up a source code file. I highly doubt many users save their source code with their images, it is very unhelpful. Perhaps you could make a registry key for where Code Lab last opened up a file?

Share this post


Link to post
Share on other sites
In other news, I really wish I knew enough to know what to test when beta testing. I feel bad.

Nah, don't worry about it.

All you need to know is that when Rick said (in the first post in this thread):

Please note that this is experimental technology and is not meant to provide a robust development environment.

It's no longer true.

CodeLab is all grown up now...

8)

Share this post


Link to post
Share on other sites

Wow :!: This is a seriously impressive update!

The new UI controls are an excellent addition and bring a whole new range of possibilities to plugins made with codelab. I'm gonna have to spend some serious play-time fiddling with the "all grown up" codelab in the next day or two.

Many thanks BoltBait, you're awesome.

Share this post


Link to post
Share on other sites

Alright, CodeLab keeps crashing and it is by calling integers. If I were to call on an int x and then give value to it later on CodeLab completely stalls up. Are there particular variables that are not allowed because of the plugin template?

Share this post


Link to post
Share on other sites
Alright, CodeLab keeps crashing and it is by calling integers. If I were to call on an int x and then give value to it later on CodeLab completely stalls up. Are there particular variables that are not allowed because of the plugin template?

Of course!

Let's look at the default script:

#region UICode
int Amount1=0;    //[0,100]Slider 1 Description
int Amount2=0;    //[0,100]Slider 2 Description
int Amount3=0;    //[0,100]Slider 3 Description
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
   // Delete any of these lines you don't need
   Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
   long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left);
   long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top);
   ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
   ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;
   int BrushWidth = (int)EnvironmentParameters.BrushWidth;

   ColorBgra CurrentPixel;
   for(int y = rect.Top; y     {
       for (int x = rect.Left; x         {
           CurrentPixel = src[x,y];
           // TODO: Add pixel processing code here
           // Access RGBA values this way, for example:
           // CurrentPixel.R = (byte)PrimaryColor.R;
           // CurrentPixel.G = (byte)PrimaryColor.G;
           // CurrentPixel.B = (byte)PrimaryColor.B;
           // CurrentPixel.A = (byte)PrimaryColor.A;
           dst[x,y] = CurrentPixel;
       }
   }
}

Obviously, you can't use the following variables:

Amount1, Amount2, Amount3... etc. -- these are use for UI elements

dst, src -- pointers to the destination and source surfaces

rect -- rectangle of the current part of the selection that we are working on

selection -- this is used to get the bounds of the current selection

CenterX, CenterY -- used to point to the center pixel of the current selection

PrimaryColor, SecondaryColor -- used to hold current color values

BrushWidth -- used to hold the current brush width as set in the main PdN UI

CurrentPixel -- used in the main loop for working with the current pixel

x, y -- loop variables

That's about it. Of course, there are others, but these are the obvious ones.

Share this post


Link to post
Share on other sites

Excuse me, I have a problem with codelab. When I click "Build dll" button an error message appears. it says

"Error at line 0: Impossible to create 'c:/Program Files/Paint.NET/Effects/CSC68A7.tmp' temporary file -- Access denied. (CS1619).

What shall I do?

Share this post


Link to post
Share on other sites

There is a bug in Version 1.0 of CodeLab. Every plugin built by this version that contains a color wheel contains the bug.

To see the bug, select a color in the color docker window that is not 100% opaque, then run an effect built by CodeLab that contains a color wheel control. This causes an unhandled exception in the plugin that is caught by Paint.NET. No data loss should occur.

I will publish a fixed version of CodeLab soon. When a revised CodeLab is published, developers will only need to rebuild an effected plugin to fix the problem. I already have the fix working on my computer. I will test it and publish very soon.

Workaround: Users, be sure that your primary color's opacity is set to 255 (100%) before running any plugin built by CodeLab.

Share this post


Link to post
Share on other sites

Hey Guys! I'm new to this forum, and new to CodeLab.

I downloaded CodeLab yesterday, and went to see BoltBaits tutorials. I made the Colour Balance Effect, but when I went to File > Save As DLL I get this error:

Error at line 0: Cannot create temporary file 'c:\Program Files\Paint.NET\Effects\CSC1120.tmp' -- Access denied. (CS1619)

I am on the Administrator Account of this computer, as it is the only account. I am not sure what else to try.

Could anyone please help me? Also, I downloaded the Plug-in from BoltBait's CodeLab page, by clicking the link in his signature.

Thanks, heri!

Share this post


Link to post
Share on other sites

If you are running in Vista, try running Paint.NET as an administrator (Yes, I know you are on an administrator account, but if you right click on a shortcut or .exe file you should see the option to run as administrator)

Share this post


Link to post
Share on other sites
If you are running in Vista, try running Paint.NET as an administrator (Yes, I know you are on an administrator account, but if you right click on a shortcut or .exe file you should see the option to run as administrator)

Yes, I am running Vista, and I read your post, and tried it. I now am discovering even more errors for some reason. I do not know what the problem is, but now I am getting at least 10 errors instead of just that one.

Share this post


Link to post
Share on other sites

CodeLab 1.1 has been released.

1.1 Release

- Colorwheel Bug Fixed

- Fixed a bug where the namespace could have bad characters in it

- Second colorwheel in a UI now defaults to secondary color

- Floating point slider control added (requested by MadJik)

- Drop-Down List Box control added

- "UserBlendOp" control added

- Script comment parsed for default effect name:

// Name: Effect Name

- Minor UI typo fixes

Go get it here: http://boltbait.com/pdn/codelab/

Share this post


Link to post
Share on other sites
CodeLab 1.1 has been released.

1.1 Release

- Colorwheel Bug Fixed

- Fixed a bug where the namespace could have bad characters in it

- Second colorwheel in a UI now defaults to secondary color

- Floating point slider control added (requested by MadJik)

- Drop-Down List Box control added

- "UserBlendOp" control added

- Script comment parsed for default effect name:

// Name: Effect Name

- Minor UI typo fixes

Go get it here: http://boltbait.com/pdn/codelab/

By the way, the CodeLab help file has been updated with a ton of example scripts here: http://www.boltbait.com/pdn/codelab/hel ... ments.asp

And, the source code to CodeLab itself has been published to the bottom of this page: http://boltbait.com/pdn/codelab/

Enjoy. 8)

Share this post


Link to post
Share on other sites

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.