Jump to content
How to Install Plugins ×

GenTree: Generator of Trees & Branches (YMD:100725)


MadJik

Recommended Posts

2 minutes ago, MadJik said:

This plugin is deprecated.

You should use this one instead:

 

 

 

 

GenTree: Generator of Trees & Branches Plugin

tree06s.jpg

(reworked tree sample: background and shadows added...)

GenTree: Generator of Trees & Branches

tree06s.jpg

(reworked tree sample: background and shadows added...)

:Warning:Warning :Warning:

Warning: Depending on the setting you choose, it could freeze PDN in some cases!

Advise: Save your work before you use this plugin!

Download it!

Plugin GenTree.dll

ar.pngHere is the DLLal.png

The source is available with the plugins package!

http://forums.getpaint.net/index.php?showtopic=7186

How to install

Close Paint.net

Unzip and (re)place the DLL in your Effect folder usually: C:/Program Files/Paint.NET/Effects

Now let's play...

How does it work?

The first point is always the middle of the bottom edge of the image.

From this point, it chooses a length and destination for the first branch.

At the end of the branch, it decides to create (or no) one new branch and it goes on with the actual branch.

Then for each branch, it redoes the same till it has reached the number of levels...

Sorry, no leaf yet on the branch...

Programming tips?

It first uses a table with the size of the image to calculate and place each pixel.

The loop is self recursive for the branches.

It means that it could be unsafe to choose a big amount for the number of levels as well as a high % for new branch.

The CPU / Memory will be impacted by this settings...

I've added Green-Red guides under critical sliders.

If you stay in the green side, it should be ok.

You could go in the red side for one slider at a time it should be still ok.

Otherwise, prepare yourself to wait for the result... :P

The user interface

GenTreeUI.png

Length of Branch: [1,100, dft:70]

Affect the length of the branch. There is also a random adjustment to make it more natural.

Chance of a Branch: [0,100, dft:70]

At each end, it decides to create a new branch or no, based on this chance in %.

100% a new branch at each end...

Initial Velocity Vertical: [-100,100, dft:20] (used in absolute value: -100 = 100)

The branches are normaly going down to the floor, following a curve.

The Vertical velocity will affect the radius of this curve.

Initial Velocity Horizontal: [-100,100, dft:0]

The horizontal velocity could be considered as a wind factor...

Reseed Value: [0,100000, dft:0]

If the value is 0, then you choose to always have something new. The random generator is free.

If the value is not 0, then the random generator will always follow a sequence of values.

The tree will be draw and redraw in the same way for the same value.

Press the button with a question mask to obtain a random value.

Number of levels(loops): [1,30, dft:15]

This value tells how many segments you want from the first to the end of the branch. The bigger this value is, and the more resource it will need!

The velocities and the length of the branches are dicreasing randomly at each level.

Inner Shadow (add noise): [yes/no, dft:no]

Choose Yes to add some noise inside the branch width. It could simulate some wood details of leaves NEW with a gradient from Secondary color at the bottom to the Primary color at the top. Use the slider to modify the noise level...

Use Brush Width: [yes/no, dft:no]

Choose Yes to enlarge the size of each point.

Use Relief: [yes/no, dft:no]

Choose Yes create as a relief aspect. The best way to use this function is in two passes: First pass with Inner Shadow ; Select a darker color for the second pass with Relief.

Test it and let me know...

Link to comment
Share on other sites

Goto here for the lastest version:

http://paintdotnet.12.forumer.com/viewtopic.php?p=67583#67583

____________________

Original version was :

____________________

GenTree: Generator of Trees & Branches

tree06s.jpg

(reworked tree sample: background and shadows added...)

Warning

Warning: Depending on the setting you choose, it could freeze PDN in some cases!

Advise: Save your work before you use this plugin!

Download

New plugin GenTree.dll

here is the zip of DLL

here is the zip of Sources

Now let's play...

How does it work?

The first point is always the middle of the bottom edge of the image.

From this point, it chooses a length and destination for the first branch.

At the end of the branch, it decides to create (or no) one new branch and it goes on with the actual branch.

Then for each branch, it redoes the same till it has reached the number of levels...

Sorry, no leaf yet on the branch...

Programming tips?

It first uses a table with the size of the image to calculate and place each pixel.

The loop is self recursive for the branches.

It means that it could be unsafe to choose a big amount for the number of levels as well as a high % for new branch.

The CPU / Memory will be impacted by this settings...

I've added Green-Red guides under critical sliders.

If you stay in the green side, it should be ok.

You could go in the red side for one slider at a time it should be still ok.

Otherwise, prepare yourself to wait for the result... :P

The user interface

GenTreeUI.png

Length of Branch: [1,100, dft:70]

Affect the length of the branch. There is also a random adjustment to make it more natural.

Chance of a Branch: [0,100, dft:70]

At each end, it decides to create a new branch or no, based on this chance in %.

100% a new branch at each end...

Initial Velocity Vertical: [-100,100, dft:20] (used in absolute value: -100 = 100)

The branches are normaly going down to the floor, following a curve.

The Vertical velocity will affect the radius of this curve.

Initial Velocity Horizontal: [-100,100, dft:0]

The horizontal velocity could be considered as a wind factor...

Reseed Value: [0,100000, dft:0]

If the value is 0, then you choose to always have something new. The random generator is free.

If the value is not 0, then the random generator will always follow a sequence of values.

The tree will be draw and redraw in the same way for the same value.

Press the button with a question mask to obtain a random value.

Number of levels(loops): [1,30, dft:15]

This value tells how many segments you want from the first to the end of the branch. The bigger this value is, and the more resource it will need!

The velocities and the length of the branches are dicreasing randomly at each level.

Inner Shadow (add noise): [yes/no, dft:no]

Choose Yes to add some noise inside the branch width. It could simulate some wood details of leaves NEW with a gradient from Secondary color at the bottom to the Primary color at the top. Use the slider to modify the noise level...

Use Brush Width: [yes/no, dft:no]

Choose Yes to enlarge the size of each point.

NEW

Use Relief: [yes/no, dft:no]

Choose Yes create as a relief aspect. The best way to use this function is in two passes: First pass with Inner Shadow ; Select a darker color for the second pass with Relief.

Test it and let me know...

EDIT1: Added shadow slider...

EDIT2: Added link to the sources...

EDIT3: Added Relief mode and [?] to give a random value...

EDIT4: Crash fixed...RC instead BETA!

Link to comment
Share on other sites

MadJik is one of my new favorite people. I can't wait for this one to go into final release!

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

MadJik is one of my new favorite people. I can't wait for this one to go into final release!

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Did ya take your sandals off?

_________________

Sorry, back on topic. Nice one Madjik (as always). I could see the Alpha becoming fairly advanced!

v An excellent open–source strategy game—highly recommended.

 

"I wish I had never been born," she said. "What are we born for?"

"For infinite happiness," said the Spirit. "You can step out into it at any moment..."

Link to comment
Share on other sites

Did ya take your sandals off?

_________________

Sorry, back on topic. Nice one Madjik (as always). I could see the Alpha becoming fairly advanced!

v An excellent open–source strategy game—highly recommended.

 

"I wish I had never been born," she said. "What are we born for?"

"For infinite happiness," said the Spirit. "You can step out into it at any moment..."

Link to comment
Share on other sites

@Madjik: Stop making cool example images and stick with the coding because frankly, it rules! Keep it up!

"The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Ezra Pound

twtr | dA | tmblr | yt | fb

Link to comment
Share on other sites

@Madjik: Stop making cool example images and stick with the coding because frankly, it rules! Keep it up!

"The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Ezra Pound

twtr | dA | tmblr | yt | fb

Link to comment
Share on other sites

@Madjik: Stop making cool example images and stick with the coding because frankly, it rules! Keep it up!

Yeah, MadJik makes us all feel a little inadequate.

----

I bet you could flip this effect over and use it as lightning. No more scribbling with the pen tool!

We're not too far away from never needing the pen tool ever again...

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

@Madjik: Stop making cool example images and stick with the coding because frankly, it rules! Keep it up!

Yeah, MadJik makes us all feel a little inadequate.

----

I bet you could flip this effect over and use it as lightning. No more scribbling with the pen tool!

We're not too far away from never needing the pen tool ever again...

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...