Modular Tree

add-ons

(enricoceric) #281

Installed the last version and crashes when I activate the addon :

Traceback (most recent call last):
File “Q:\shareWin64\Blender279\2.79\scripts\modules\addon_utils.py”, line 331, in enable
mod = import(module_name)
File “Q:\shareWin64\Blender279\2.79\scripts\addons\modular_tree-rewrite_all_init_.py”, line 966, in <module>
from .nodes import node_classes_to_register, node_categories
File “Q:\shareWin64\Blender279\2.79\scripts\addons\modular_tree-rewrite_all
odes.py”, line 17, in <module>
from .wind import wind
File “Q:\shareWin64\Blender279\2.79\scripts\addons\modular_tree-rewrite_all\wind.py”, line 271, in <module>
add_f_curve_modifiers(bpy.context.object)
AttributeError: ‘_RestrictContext’ object has no attribute ‘object’


(Maxime) #282

Thanks, this will be fixed in the next commit, but I wouldn’t recommend testing the wind yet, there are no safeguards!


(Maxime) #283

I’ve managed to make the wind simulation run in real time.


(kabu) #284

Cool. That could be turned into an influence map for using with a game engine or external renderer…


(AFWS) #285

Hey Maxime,

Can you turn the height and radius settings into dimension setting? Right now, I have to create a cube the size I want and then keep scaling the tree til it matches.


(Maxime) #286

You mean a scale setting, to adjust the scale of the tree after its generation ?


(AFWS) #287

i guess that’s what I’m talking about. I will make some pics later today to show what I’m talking about.


(marcoso) #288

I have understand nothing:i generate the tree but when i make twig and i select twig in the advanced settings i update the tree but appear only little planes on the branches.
Great add on the trees generated looks very good like GROW FX, 'd like to merge my scanned trunk on agis with the tree generated.


(jkofskie) #289

I made an account for blenderartists literally just to tell you how amazing and easy this is. Thank you so much for creating this and sharing it for free!


(Maxime) #290

Quick update:

I have implemented the resolution idea that pushed me to rewrite the addon: The tree is now subdivided according to the branches radius. That means the trunk has a lot of details and the smallest branches have a rectangular base.
Here is an example:




This tree only has 140 000 verts !
I have also added the particle system generation and a trunk node.

The next release is near !


(AFWS) #291

Now this is cool. Is this something you can turn on and off?


(Maxime) #292

@AFWS You can choose the max number of subdivisions, so at 0 it’s turned off.


(Maxime) #293

I have updated the roadmap here, so you guys can track my progress.


(Mandalorian) #294

Very cool. Very excited to use the new node workflow with this functionality.


(JustinBarrett) #295

Oh hell yes.


(lolwel21) #296

This is an idea for (possibly a later iteration of) the node tree workflow.
Could the ‘voxel AO’ style trimming algorithm be given anisotropy, and/or a conversion to a cone tracing algorithm (using the same voxels)?
The conversion could do a few things:

  1. Yield more flexible and realistic results (control over number of samples, vertical anisotropy of said sample placements)
  2. Allow the output of the trimming node to be useful in determining optimal twig placement.
    Just look at some really dense trees/hedges, and you’ll find there are almost no leaves on the inside. This could in turn save a little memory and a LOT of rendering time, while only adding to the overall realism of the tree!

By the way, I love the realtime wind effect, but it should affect the small branches a lot more and the trunk a lot less. Would it be possible to make this edit without overhauling your entire algorithm?


(Maxime) #297

@lolwel21
Thanks for your input, those are good ideas but I replaced the previous data structure I used for pruning by a simple dictionary, which is faster, but won’t allow what you are proposing.

I have just added an operator to add procedural details at the base of the trees:



(lolwel21) #298

Using a dictionary for the pruning? Now I’m kind of curious as to how that’s implemented. What do you mean by that? Based on your other recent posts, I got the impression that you were using a voxel array or octree.


(Maxime) #299

I was using a tree, but it was a bit overkill. Now I simply round the branches coordinates to a certain resolution, and add the radius to the previous density value in a dictionary, using the rounded coordinates as keys. When two branches are close they will share the key, and the branching is determined according to the density and pruning strength.
To simulate anisotropy, I can simply make the pruning strength vary with the branch direction, I don’t need to change the density values.

In the future I may be checking adjacent cells to do kind of a voxel antialiasing to prevent the lack of pruning when two branches are close, but in different cells.

I have also thought computing the density gradient at the branch position to orientate it toward the most available region, and even use this to fill a user defined volume, but my main concern is speed, as I want the user to be able to tweak the tree in real time.

In time, I will write the tree functions in cython, or directly in c++ to allow myself to add more computation heavy features.


(Maxime) #300

I am working on a procedural bark material, here is the current result: