Modular Tree

have you also pulled the submodules (vcpkg and pybind11) ?

Submodules? I only did the steps that I pasted above, mainly clone --recursive, checkout new branch, start .sh - just like in the installation instructions on your github.

The --recursive is supposed to pull the submodules as well, but it didn’t since master didn’t have any submodules (this should be resolved now that I have merged mtree_rework into master)

To solve your issue you can run git submodule update --init --recursive

2 Likes

Mtree 4.0.0 is released !

you can download it here.

Changes:

  • complete c++ rewrite with python bindings
  • Faster tree generation
  • more natural looking branches
  • Better mesh topology
  • Leaves/twigs are scattered using geometry nodes

Missing features:

  • twig procedural generation
  • materials
  • roots
  • grease pencil guiding
  • armature and wind

Missing features will be reintroduced in future releases.

I intend to take full advantage of geometry nodes for bark displacement, wind and twigs generation; so future releases will probably be compatible only for blender 3.0.0 and above.

35 Likes

Nice! Downloading it now!

edit: Think I may have found a bug right out the gate. I installed the addon without issue, restarted Blender as a just-in-case measure, reopened it, and started doing the usual MTree spiel.

When I popped the Tree Mesher onto the grid, it created a LOAD of empty tree objects, 118 altogether, with the last tree on the list being the active, editable object. I’m assuming it’s not supposed to do this, correct?

For reference, I’m on Fedora 35, Blender 3.0 Official. Here’s a shot of the resulting tree spammage.

1 Like

yes finaly

thanks for the info, I’m taking a look

1 Like

The good news is I’m still able to use it. I deleted all but the last tree, and began working on building a quick tree. The weird thing is, it always wants to recreate the base ā€œtreeā€ object, even though tree.117 is the active one being displayed. Plus, it’ll randomly pop out a new tree object on occasion, not due to any action I’ve made, but…just because.

I can’t reproduce the issue, when you create a mesher node, do you have an object field like in this picture ?
image

No, the Tree Mesher node only has Generate Tree, and Add Leaves. It doesn’t give me any options for resolution or smoothness.

And speaking of which, when I click Generate Leaves, it gives me a number of Python errors. I figured it was because you’re still using the old node set, so I enabled Legacy Nodes in the Experimental tab, and…no luck. Still does the same thing.

Even though I uninstalled the older MTree addon, do you think there might be some lingering files about, causing a conflict? Though I hate to do this, I’ll reset everything back to Blender default, see if that gives me any improvements.

Well, that didn’t fix much, though I did figure out how to replicate the duplicating tree issue.

If you create a new tree from the default cube, it doesn’t give you a ton of duplicates. It all remains confined to the cube. But if you delete the default cube, and create a new tree from inside MTree, that’s when it starts spitting out duplicates.

Though I’m still not able to get a Tree Mesher node with the settings in your shot, and creating leaves gives me this error:

That’s very strange, this is supposed to be fixed, and I checked the files of the linux version.

can you send me the addon archive ?

Hold on, I think I might know what the problem is, and that I might be dumb. Gimme a couple.

Okay, here’s what happened.

I had one of your old alpha builds still sitting about in my Downloads folder. It’s called modular_tree_4_0_0_linux.zip. When I went to download the final rev you linked to above, it saw that it had a similarly named file in there, so it changed it modular_tree_4_0_0_linux(1).zip…

…which I didn’t notice. So when I went to install it, guess which I used? Yup. That was the problem. Didn’t notice it until I went to look at the archive, then it finally occurred to me.

I’ve since deleted the two files, and redownloaded the final to triply check and make sure I was getting the right file, installed it, and it looks like it’s working perfectly.

Sorry for the drama. :stuck_out_tongue:

1 Like

Happens to the best of us !

2 Likes


i have nothing bether to do in my live so i made the leave distrobution with feelds

6 Likes

This is extremely fast. thank you

1 Like

I’m loving the update, especially how fast it is!

One quick note, tho — IDK if this is a bug or a feature, but on my system (Mac), the first time I add leaves to a tree, I get an error message similar to the one Renzatic reported earlier.

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "/Users/**********/Library/Application Support/Blender/3.0/scripts/addons/modular_tree/python_classes/operators.py", line 38, in execute
    distribute_leaves(ob)
  File "/Users/**********/Library/Application Support/Blender/3.0/scripts/addons/modular_tree/python_classes/resources/node_groups.py", line 11, in distribute_leaves
    modifier.node_group = ResourceUtils.append_geo_node("leaves_distribution")
  File "/Users/**********/Library/Application Support/Blender/3.0/scripts/addons/modular_tree/python_classes/resources/resource_utils.py", line 18, in append_geo_node
    bpy.ops.wm.append(filepath=filepath,filename=name,directory=directory, autoselect=False)
  File "/Applications/Blender.app/Contents/Resources/3.0/scripts/modules/bpy/ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: './resources/geo_node/geo_nodes_2_93.blend/NodeTree/leaves_distribution': not a library

To be clear, the leaves system does create a new blank Geometry Node, but geo_nodes_2_93.blend is not appended, nor the leaves mesh in that file imported.

I’ve re-downloaded and re-installed the addon a few times to confirm, and the issue is consistent.

In any case, I filled in the Geo Node by following the example provided by Slinc_HD’s screenshot, and made my own leaves.

It looks pretty nice for a quick and dirty.

Anyway, thanks again for the addon. I’ll keep an eye on this thread for news of updates.

2 Likes

can this be used like speed tree to quickly make trees for games ?

It just occurred to me to try manually appending the twig collection from geo_nodes_2_93.blend into my new Blender file before I ran Add Leaves, and with that everything processed without issue.

Hurr durr, right?

One other thing I’ve noticed is that the tree mesh is created with flipped normals. IDK if there’s a reason for this, but I just make sure to either flip them or recalc outside, and then all is good.