Jump to content
How to Install Plugins ×

Bricks (updated with examples)


jchunn

Recommended Posts

This plugin is a part of the "Jesse Chunn Plugin Pack" and can be downloaded HERE

Once installed, "Bricks" will show up in the "Render" submenu.

Here are some examples:

This image uses "Bricks" to create texture.

file.php?id=1291

Here is a tutorial to create a brick wall.

(link to old forum removed - please use search: http://searchpaint.net/ )

This effect is a part of Jesse Chunn Plugin Pack located at:

Jesse Chunn Plugin Pack

All comments welcome.

Regards,

Jesse Chunn.

Total hack.

Link to comment
Share on other sites

I've got 2 bricks and 2 varicose and i've got a error with my version(3.20)

File: C:\Program Files\Paint.NET\Effects\jchunn.dll
     Effect Name: PDNPI_IndirectUI.Bricks
     Full error message: System.InvalidCastException: Specified cast is not valid.
  at PaintDotNet.PropertySystem.Property`1.ValidateNewValue(Object newValue)
  at PaintDotNet.PropertySystem.Property.SetValueCore(Object value)
  at PaintDotNet.PropertySystem.Property.set_Value(Object value)
  at PaintDotNet.IndirectUI.ControlInfo.SetPropertyControlValue(Object propertyName, Object controlPropertyName, Object propertyValue)
  at PDNPI_IndirectUI.Bricks.OnCreateConfigUI(PropertyCollection props)
  at PaintDotNet.Effects.PropertyBasedEffect.CreateConfigDialog()
  at PaintDotNet.Menus.EffectMenuBase.RunEffect(Type effectType)

Link to comment
Share on other sites

Nice job on the new one. Was it made in VB.NET as well?

Thanks, and yes. I just added the new plugin to the existing code (added a class).

I've got 2 bricks and 2 varicose and i've got a error with my version(3.20)
But I've got 2x Bricks... in my menu!

Not sure why you have 2 bricks. I changed the filename of the dll, so it makes sense that you would have 2 varicose (the old one and the one in this dll)... just delete the old varicose.dll and you should be fine. I'll try not to change file names in the future to avoid that problem. If you delete varicose.dll and still see 2 bricks OR 2 varicose, let me know.

As for your error, I am running 3.22, so maybe there is a compatibility problem... not sure, but it seems to work fine for me. I am checking all types, and the input controls (I assume) will not allow invalid input.

Total hack.

Link to comment
Share on other sites

I've got 2 bricks and 2 varicose and i've got a error with my version(3.20)

File: C:\Program Files\Paint.NET\Effects\jchunn.dll
     Effect Name: PDNPI_IndirectUI.Bricks
     Full error message: System.InvalidCastException: Specified cast is not valid.
  at PaintDotNet.PropertySystem.Property`1.ValidateNewValue(Object newValue)
  at PaintDotNet.PropertySystem.Property.SetValueCore(Object value)
  at PaintDotNet.PropertySystem.Property.set_Value(Object value)
  at PaintDotNet.IndirectUI.ControlInfo.SetPropertyControlValue(Object propertyName, Object controlPropertyName, Object propertyValue)
  at PDNPI_IndirectUI.Bricks.OnCreateConfigUI(PropertyCollection props)
  at PaintDotNet.Effects.PropertyBasedEffect.CreateConfigDialog()
  at PaintDotNet.Menus.EffectMenuBase.RunEffect(Type effectType)

Aren't you supposed to have the latest version?

=========================

I'll try this plugin in a few!

:D

MyBB Tutorials, check out my site. :)
Link to comment
Share on other sites

I've got 2 bricks and 2 varicose and i've got a error with my version(3.20)

File: C:\Program Files\Paint.NET\Effects\jchunn.dll
     Effect Name: PDNPI_IndirectUI.Bricks
     Full error message: System.InvalidCastException: Specified cast is not valid.
  at PaintDotNet.PropertySystem.Property`1.ValidateNewValue(Object newValue)
  at PaintDotNet.PropertySystem.Property.SetValueCore(Object value)
  at PaintDotNet.PropertySystem.Property.set_Value(Object value)
  at PaintDotNet.IndirectUI.ControlInfo.SetPropertyControlValue(Object propertyName, Object controlPropertyName, Object propertyValue)
  at PDNPI_IndirectUI.Bricks.OnCreateConfigUI(PropertyCollection props)
  at PaintDotNet.Effects.PropertyBasedEffect.CreateConfigDialog()
  at PaintDotNet.Menus.EffectMenuBase.RunEffect(Type effectType)

Looks like jchunn is probably using PdnResources to load some text. If so, this plugin will not work in future versions of Paint.NET. Plugins must not use PdnResources.

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

Looks like jchunn is probably using PdnResources to load some text. If so, this plugin will not work in future versions of Paint.NET. Plugins must not use PdnResources.

No, I am not. The plugin is not doing anything out of the ordinary. I am at work, so I can't post the latest source, but I am not doing anything differently than what is in this earlier version, other than re-arranging some of the effect logic for the "bricks" effect:

http://paintdotnet.forumer.com/download/file.php?id=1193

That is vb.net, but it is very simple and easy to follow. Certainly, a quick look will make it obvious that (unless I am completely missing something) I am not doing anything fancy with resources. I am simply modifying a few pixels. Very straightforward stuff.

It is possible that I have a reference to the resources dll, but if I do, it was simply a matter of setting the reference, and never using it.

If you (Rick) want to just quickly open the source and take a quick look (even in notepad if you didn't install vb) you should be able to verify that I am not doing anything out of the ordinary. If I am, let me know what it is and I'll go back to the drawing board, but this is pretty basic stuff, so I'd doubt it.

The only thing I "am" doing that is different from the other examples I've seen posted is that I am using the "my.resources" namespace, instead of embedding the resources the way others are doing it in C#, strictly for the effect icon... but that shouldn't matter since I am still just returning a bitmap.

Any feedback would be appreciated.

Regards.

Total hack.

Link to comment
Share on other sites

If you are getting duplicates (more than one copy of bricks or varicose in your effects menu), please try the following and let me know if this fixes the problem.

1. Close all instances of PDN.

2. Go to "c:\program files\Paint.Net\effects\" (or whereever your "effects" folder is).

3. Delete varicose.dll AND jchunn.dll.

4. Run PDN.

5. Verify that you do not have any of the following effects in the effect menu:

effects->object->Varicose

effects->render->Varicose

effects->render->Bricks

If you have any of those, well... you have something seriously wrong with your installation, or you didn't "really" delete the files, or your effects folder is not where you think it is, or something else has gone wacky with your computer.

7. Close PDN again.

6. Re-download "jchunn.zip".

7. Unzip "jchunn.zip" and verify that it contains ONLY jchunn.dll.

8. Copy ONLY "jchunn.dll" to your effects folder.

9. Run PDN.

10. Verify that you have the following effects:

One copy of effects->render->Varicose

One copy of effects->render->Bricks

NO copy of effects->object->Varicose

If you do all that, and still have two copies of either bricks or varicose (or both), please post here again... that means either something is wrong with the plugin, something is wrong with PDN, or something is wrong with your installation... and I'll need to try and figure out which one it is.

Total hack.

Link to comment
Share on other sites

No, I am not. The plugin is not doing anything out of the ordinary. I am at work, so I can't post the latest source, but I am not doing anything differently than what is in this earlier version, other than re-arranging some of the effect logic for the "bricks" effect:

http://paintdotnet.forumer.com/download/file.php?id=1193

That is vb.net, but it is very simple and easy to follow. Certainly, a quick look will make it obvious that (unless I am completely missing something) I am not doing anything fancy with resources. I am simply modifying a few pixels. Very straightforward stuff.

It is possible that I have a reference to the resources dll, but if I do, it was simply a matter of setting the reference, and never using it.

If you (Rick) want to just quickly open the source and take a quick look (even in notepad if you didn't install vb) you should be able to verify that I am not doing anything out of the ordinary. If I am, let me know what it is and I'll go back to the drawing board, but this is pretty basic stuff, so I'd doubt it.

The only thing I "am" doing that is different from the other examples I've seen posted is that I am using the "my.resources" namespace, instead of embedding the resources the way others are doing it in C#, strictly for the effect icon... but that shouldn't matter since I am still just returning a bitmap.

Any feedback would be appreciated.

Regards.

Doesn't look like a resource problem, like you say. I was simply listing the likeliest coding mistake that I've seen cause that to happen in the past.

The only thing I can nail it down to is the 6 calls to SetPropertyControlValue where you aren't sending strings:

configUI.SetPropertyControlValue(Settings.Width, ControlInfoPropertyNames.SliderLargeChange, 10.0#)

Is "10.0#" the VB syntax for a System.Double or a System.Single (aka double or float, at least in C#) ? In either case, those properties need a System.Double and we've been seeing some cases where the .NET Runtime is being cranky about value unboxing-then-casting where it wasn't before, or where we aren't expecting it to be.

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

The only thing I can nail it down to is the 6 calls to SetPropertyControlValue where you aren't sending strings:

configUI.SetPropertyControlValue(Settings.Width, ControlInfoPropertyNames.SliderLargeChange, 10.0#)

Is "10.0#" the VB syntax for a System.Double or a System.Single (aka double or float, at least in C#) ? In either case, those properties need a System.Double and we've been seeing some cases where the .NET Runtime is being cranky about value unboxing-then-casting where it wasn't before, or where we aren't expecting it to be.

From the vb.net documentation:

Appending the identifier type character # to any identifier forces it to Double.

The equivalent .NET data type is System.Double.

I could change the code to be more explicit (ctype(xxx, system.double)), but it should work the way it is.

I'll change it for the next release, just in case. The stack trace seems to agree with what you are saying, but I don't know why it would work for me and others most of the time but then fail "occasionally".

If anyone else experiences these errors (or any errors) it would be very helpful if I had another stack trace, just to verify this was not related to people having two versions installed at the same time, somehow confusing the runtime (.Net) or the host (PDN).

Thanks for following up Rick.

Total hack.

Link to comment
Share on other sites

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