Jump to content
How to Install Plugins ×

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


Recommended Posts

11 minutes ago, xrModder said:

How to place a listbox and a checkbox on the same line?

 

I don't think it is possible using IndirectUI.

  • Upvote 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

CodeLab v6.10 Released

This is only for Paint.NET 5.0.11+!

 

Big update today...

 

Changes:

 

▪ Ability to configure color context to use WorkingSpace @Rick Brewster

▪ Only one menu entry now (configure Render Options on the configuration screen) @toe_head2001

▪ Improvements to autocomplete @toe_head2001

▪ New UI element Layer Chooser @BoltBait

▪ Templates now have links to tutorials @BoltBait

▪ Default effect type is now GPU Image effect @BoltBait

▪ Lots of bug fixes and small enhancements @toe_head2001 / @BoltBait / @Rick Brewster

 

ALL NEW TUTORIALS: https://boltbait.com/pdn/CodeLab/help/tutorial/ @BoltBait

 

 

Grab the CodeLab DLL here:

 

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

 

Screenshots:

 

Only one menu entry:

image.png

New settings page to control how CodeLab is run:

image.png

Notice that in the next screenshot, the Render Options are shown in parenthesis.

 

New Layer Chooser UI Control:

image.png

 

  • Like 3
  • Upvote 1
  • Hooray 1
Link to comment
Share on other sites

  • BoltBait changed the title to CodeLab v6.10 for Paint.NET 5.0.11 (Updated October 12, 2023)

@BoltBait I don't think this was intentional. image.png.345132999ca9c6723f9df7e9c13c0290.png

 

Nor this 

 

 

 

Spoiler

Application version: paint.net 5.0.11 (Stable 5.11.8685.3093)
Time of crash: 10/15/2023 12:39:40 PM
Application uptime: 00:11:44.0489858
Application state: Running 
Working set: 474,424 KiB
Handles and threads: 1524 handles, 60 threads, 273 gdi, 214 user
Install type: Classic
Application directory: C:\Program Files\paint.net
Current directory: C:\Program Files\paint.net
Install directory: C:\Program Files\paint.net
OS Version: Windows 10 Home 10.0.19045.0 x64
.NET version: .NET 7.0.12 x64
Processor: "Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz" @ ~3193MHz (4C/4T, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2)
Memory: 8,143 MB physical (1,927 MB free), 133,947,456 MB virtual free, 18,987 MB pagefile (8,175 MB free)
Video card: NVIDIA GeForce GT 720 (fl:11.0, v:10DE, d:1286, r:A1), Microsoft Basic Render Driver (fl:12.1, v:1414, d:8C, r:0)
Hardware acceleration: True (default: True) (rendering: 🚀 Performance (NVIDIA GeForce GT 720))
Remote session: no
Pointers: none
UI animations: True
UI DPI: 96 dpi (1.00x scale)
UI theme: VisualStyleCategory=Aero, EffectiveTheme=Aero, DWM=yes, AeroColorScheme=Dark, ThemeFileName=Aero.msstyles
Updates: True, 10/15/2023
Locale: pdnr.c: en-US, hklm: en-US, hkcu: en-US, cc: en-US, cuic: en-US
Flags: 

Exception details:
System.TypeInitializationException: The type initializer for 'PdnCodeLab.Intelli' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'OptionBasedLibrary v0.7.9, Version=0.7.9.1561, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'OptionBasedLibrary v0.7.9, Version=0.7.9.1561, Culture=neutral, PublicKeyToken=null'
   at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at PdnCodeLab.Intelli.<>c__DisplayClass66_0.<.cctor>b__1(Assembly a)
   at System.Linq.Enumerable.WhereArrayIterator`1.ToArray()
   at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
   at PdnCodeLab.Intelli..cctor()
   --- End of inner exception stack trace ---
   at PdnCodeLab.CodeTextBox.ParseVariables(Int32 position, Boolean localOnly)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

 

If I had received a notification when you posted it - You would have had this sooner.

The issue was caused when I ran Codelab a second time.

Hope this helps :)

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

30 minutes ago, AndrewDavid said:

System.TypeInitializationException: The type initializer for 'PdnCodeLab.Intelli' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'OptionBasedLibrary v0.7.9, Version=0.7.9.1561, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

 

As mentioned to you before, this is a bug with the Plugin Browser.  I'll try to release a bugfix release later today.

(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 just discovered those two files were in a separate directory. If after running Plugin browser and then going into Codelab is the bug, then OK. I have never had a problem with the plugin browser itself. Maybe I don't use it enough to cause a crash but I do use it to ensure builds reflect the proper information. 

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

On 10/23/2023 at 10:40 PM, Rick Brewster said:

Just use Environment.Document.Size

How? I want to get the width and height of an image inside a loop:

void Render(Surface dst, Surface src, Rectangle rect)
{
	for (int y = rect.Top; y < rect.Bottom; y++)
	{
		if (IsCancelRequested)
			return;

		for (int x = rect.Left; x < rect.Right; x++)
		{
			ColorBgra srcPixel = src[x, y];
			ColorBgra dstPixel = dst[x, y];

			// Here

			dst[x,y] = CurrentPixel;
		}
	}
}

 

Link to comment
Share on other sites

First, I recommend implementing a "Bitmap" Effect, not a "classic" Effect. You need the latest CodeLab for this. Then you'll have access to Environment.Document.Size, as well as all the other new stuff.

 

image.png

The classic effect system is going to be deprecated soon (i.o.w. it'll be marked with [Obsolete] attributes, and you won't be able to compile for it), so there's no point in learning or using that system anymore. Bitmap Effect and GPU Image/Drawing Effect are the new replacements.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 2 weeks later...

In my week of playing with CodeLab I've found the following issues (or I'm misunderstanding something):

 

1. Rich text help doesn't work on anything but classic plugins. Providing a rich text help and then trying to build gets you errors like this:

Error at line -104: The type or namespace name 'SizeF' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Error at line -100: The type or namespace name 'Size' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Error at line -92: The name 'Icon' does not exist in the current context (CS0103)
Error at line -92: The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Error at line -81: The type or namespace name 'Point' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Error at line -70: The type or namespace name 'Font' could not be found (are you missing a using directive or an assembly reference?) (CS0246)

 

My C# knowledge is limited, but that seems like it's not including some namespace it should be using? Works on a classic plugin.

 

2. Default values for many controls are acting weird: string and multiline string have no way of providing a default value, the value you put inside the definition seems to work if you read it but it's not visible on the UI. Reseed control accepts a default value, but it doesn't work on a compiled plugin, only inside CodeLab - it starts always at 0 as a standalone effect.

 

3. From what I understand adding a reseed button is supposed to add a Random into the class, but it's inaccessible: the RandomNumber member or its seeds are not visible to the script.

 

4. You're allowed to check the Straight alpha/Working space gamma build options for a non-GPU plugin, but if you do, it adds a malformed render info flags into the generated code and it won't compile. Maybe should be disabled, or at least not try to add non-existent flags?

Link to comment
Share on other sites

2 hours ago, frio said:

My C# knowledge is limited, but that seems like it's not including some namespace it should be using?

 

Probably System.Drawing, which generally should not be used in GPU or Bitmap effects.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

1 hour ago, Rick Brewster said:

 

Probably System.Drawing, which generally should not be used in GPU or Bitmap effects.

 

Yes, @toe_head2001 already checked in a fix for that issue.  We just needed to specify the names because we removed System.Drawing from our using list for GPU effects.

Link to comment
Share on other sites

1 minute ago, Nerd-ish said:

Hi there! Thank you all for CodeLab being an awesome "plugin". However, I couldn't find a way to use default/non-integrated adjustments and non-integrated effets. Is there any?

 

What, EXACTLY, are you trying to use?

Link to comment
Share on other sites

  • 3 weeks later...

CodeLab v6.11 Released

This is only for Paint.NET 5.0.11+!

 

Small update today...

 

Changes:

 

▪ Allow more icon sizes @toe_head2001 / @BoltBait

▪ Enable code folding on #Region @toe_head2001

▪ Source Code viewer has syntax highlighting @toe_head2001

▪ Fix RTF help for plugins @toe_head2001

▪ Enhancements for Dark Mode @toe_head2001

▪ Remove new build options for Classic effects @BoltBait

▪ Add string UI control defaults @BoltBait

▪ Fix Randomize bugs with built scripts @BoltBait / @toe_head2001

▪ Some bug fixes and small enhancements @toe_head2001 / @BoltBait / @Rick Brewster

 

Grab the CodeLab DLL here:

 

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

 

  • Like 1
  • Upvote 3
Link to comment
Share on other sites

  • BoltBait changed the title to CodeLab v6.11 for Paint.NET 5.0.11 (Updated December 3, 2023)
  • 2 months later...

CodeLab v6.12 Released

This is only for Paint.NET 5.0.12+!

 

Small update today...

 

Changes:

 

▪ CodeLab now detects if a project type changes (only for C# project types) and will automatically adjust during build. @toe_head2001 

▪ Some bug fixes and small enhancements @toe_head2001 / @BoltBait

 

Grab the CodeLab DLL here:

 

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

 

Screenshots:

 

There is now a new menu item: File > New > From Clipboard

 

image.png

If you have a CodeLab script on your clipboard, this is a quick, efficient way to get that into CodeLab.

 

image.png

When you paste a script into CodeLab, it will detect the type of C# script it is and automatically adjust for you.

 

 

  • Like 1
  • Thanks 1
  • Upvote 1
Link to comment
Share on other sites

  • BoltBait changed the title to CodeLab v6.12 for Paint.NET 5.0.12 (Updated February 11, 2024)
  • 2 months later...

Hi.
Do CodeLab support call of another plugins with setting settings?
I want to call few plugins in a row. And repeat it for few images with the same plugins settings

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

×
×
  • Create New...