Modular Tree

most of the time the generated branches don’t cover a circular distribution(from top view) for e.g. the Oak preset the branches are generated mostly in xz plane.in nature the boughs try to cover spherical area covering all angles.and i think branch level control of length,angle will be needed for generating more variety of trees.

Setting Normals…
Unwrapping…
THERE ARE NO UVLAYERS FOR THIS LOOP!
Traceback (most recent call last):
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/generator_operators.py”, line 50, in execute
create_tree(scene.cursor_location)
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/tree_creator.py”, line 903, in create_tree
rotate() # this will set the mode to object already
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/uv_tools.py”, line 57, in rotate
bpy.ops.uv.pack_islands(rotate=False, margin=0.001)
File “/home/nk/usr/bin/blender/blender-2.78-cade262-linux-glibc219-i686/2.78/scripts/modules/bpy/ops.py”, line 189, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.uv.pack_islands.poll() failed, context is incorrect

location: <unknown location>:-1

location: <unknown location>:-1

Hi there Graphics_Dev, unfortunately still same problem I guess…

Notice that I’m running Blender within its folder, and there is .config in home.

Setting Normals…
Unwrapping…
THERE ARE NO UVLAYERS FOR THIS LOOP!
Traceback (most recent call last):
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/generator_operators.py”, line 190, in execute
twig_leafs = create_tree(scene.cursor_location, is_twig=True)
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/tree_creator.py”, line 903, in create_tree
rotate() # this will set the mode to object already
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/uv_tools.py”, line 57, in rotate
bpy.ops.uv.pack_islands(rotate=False, margin=0.001)
File “/home/nk/usr/bin/blender/blender-2.78-cade262-linux-glibc219-i686/2.78/scripts/modules/bpy/ops.py”, line 189, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.uv.pack_islands.poll() failed, context is incorrect

location: <unknown location>:-1

location: <unknown location>:-1

And here is the same error with different lines when you create a twig.

Thanks in advance for your hard work!

@crazyrobinhood2 Could you tell me what all of your settings are so I can reproduce them? (see my comment a bit ago to “see” the hidden settings)

nk@debian:~/usr/bin/blender/blender-2.78-cade262-linux-glibc219-i686$ ./blender
Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Read new prefs: /home/nk/.config/blender/2.78/config/userpref.blend
found bundled python: /home/nk/usr/bin/blender/blender-2.78-cade262-linux-glibc219-i686/2.78/python
read blend: /media/nk/WD_Black/z/NK/3d/blender_tests/modulartree/test-bug.blend
Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

                                            ______

__ __ _ _ / *
| / | ___ | | _ _ | | __ _ _ __ _* *_/ _ __ ___ ___
| |/| | / _ \ / _ || | | || | / _ || '
| | || | '|/ _ \ / _
| | | || () || (| || || || || (| || | || | | | | /| /
|| || _
/ _,| _,||| _,||| / | \ |_| _
| _
|

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

Blend file saved…

Generating Branches…
Building Object…
Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Setting Normals…
Unwrapping…
THERE ARE NO UVLAYERS FOR THIS LOOP!
Traceback (most recent call last):
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/generator_operators.py”, line 50, in execute
create_tree(scene.cursor_location)
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/tree_creator.py”, line 903, in create_tree
rotate() # this will set the mode to object already
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-bug_tracking/uv_tools.py”, line 57, in rotate
bpy.ops.uv.pack_islands(rotate=False, margin=0.001)
File “/home/nk/usr/bin/blender/blender-2.78-cade262-linux-glibc219-i686/2.78/scripts/modules/bpy/ops.py”, line 189, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.uv.pack_islands.poll() failed, context is incorrect

location: <unknown location>:-1

location: <unknown location>:-1

that’s the whole console.

Here you can find the blend file.
There is inside the NK-multishader I did, if you wnat to test it :slight_smile:

http://www.crazyrobinhood.org/nextcloud/index.php/s/c77RDDT7CH2f5ZL

@crazyrobinhood2 Thanks for the help! I think it is fixed. Please checkout the new one on the bug_tracking branch here and let me know if all’s well for you.

The problem that I fixed is that it selects all necessary edges, but not in a connective way. Then it tries to unwrap, doesn’t get anything unwrapped, then tries to pack the uvs. Because there are no uvs the call to the pack operator gives a context error from its poll method. This, of course, crashes the script and reports the error that you see. To fix the problem, I added a line to change to vertex selection mode which allows to select everything correctly before unwrapping, which allows there to be uvs to pack. This issue is why when it crashes, the info bar indicates that you have somethings selected (verts, edges, etc.), but the viewport doesn’t show anything selected unless you switch to vertex selection mode.

I confirm: Everything is perfect now!
Thanks for your effort in solving issues.
Teamwok is always the best!
This is one of the best tree generators out there, and it is , as it always should be, a free project.
Those kind of plugins really makes the community grow fast.
THANKS!

@crazyrobinhood2 Alright, thanks for the feedback! I moved it to a new release (would you mind using the “check for updates” button in the user prefs to verify that it notifies you of an update).

BTW How do you like the documentation project? What should I focus on in my spare time?

Good riddance of that UV bug, well done and thanks for the explanation!

@crazyrobinhood2: You were just ahead of me with the testing … I couldn’t agree more with your post above.

@Remade: you have a point about the ‘naturalness’ of the branches but that would be an entirely new level of simulation sophistication, introducing biology. If there exists any totally free software that can do it, please let me know :slight_smile:
One way to make things even more interesting: make more parameters depend on iterations rather than being constant values, for example: branches getting longer when iterations increases.

Keep up the good work!

If you check the wiki roadmap, you will see that curve based settings are on there. This would be the “cleanest” solution, but it is actually fairly difficult (especially for the preset saving). I have it started on a branch on my local machine, but it certainly isn’t ready for production yet, nor do I know if I will ever decide to do it that way. I may make my own system as that would be more easily saved.

Hi there.
Still some issues creating the armature.
here is the log

Ps. Do you know some good site for barks and leaves texture?
Are you planning to include some inside the presets?
Thanks!

__ __ _ _ / *
| / | ___ | | _ _ | | __ _ _ __ _* *_/ _ __ ___ ___
| |/| | / _ \ / _ || | | || | / _ || '
| | || | '|/ _ \ / _
| | | || () || (| || || || || (| || | || | | | | /| /
|| || _
/ _,| _,||| _,||| / | \ |_| _
| _
|

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

Blend file saved…

Generating Branches…
Building Object…
Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Setting Normals…
Configuring Particle System…
Unwrapping…
Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Setting Materials…
Building Armature…
Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Dependency cycle detected:
Camera-focus depends on NK-camera through Parent.
NK-camera depends on Camera-focus through Camera DoF.

Traceback (most recent call last):
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-master/generator_operators.py”, line 50, in execute
create_tree(scene.cursor_location)
File “/home/nk/.config/blender/2.78/scripts/addons/modular_tree-master/tree_creator.py”, line 944, in create_tree
mtree_props.objects.active = arm
AttributeError: ‘ModularTreePropertyGroup’ object has no attribute ‘objects’

location: <unknown location>:-1

location: <unknown location>:-1

PS yes it notify me of an update trough prefs

Alright,

  1. I will take a look at the bone issue when I get a chance but no promises yet…
  2. I like to use textures.com but some others that allow for commercial sale of artwork that uses the images (at least in some way…you’ll need to read their individual licenses) include:

texturer.com
textureking.com
texturelib.com
freshtextures.com
textures.forrest.cz
texturez.com
freestocktextures.com

  1. Glad check for updates worked!

That was an easy fix…it was a simple problem I was expecting more of when I did the property group fix.

Thank you!
Now it seems everything is ok.
Except for update the tree… it keeps show errors.
do you need log?

What kind of errors? Is it this problem?

exactly.
thanks for the reply!

Hi,
I’m unable to enable the addon, it prompts:

Traceback (most recent call last):
File “C:\Program Files\Blender Foundation\Blender\2.78\scripts\modules\addon_utils.py”, line 349, in enable
mod.register()
File “C:\Users\r\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\modular_tree-master_init_.py”, line 682, in register
save_addon_name(name)
File “C:\Users\r\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\modular_tree-master\addon_name.py”, line 8, in save_addon_name
with open(“addon_name.txt”, ‘w’) as f:
PermissionError: [Errno 13] Permission denied: ‘addon_name.txt’