[AddOn] Parametric Tree (via frame change event) 2.56 r35129

Hi All,

When I saw TrumanBlending’s parametric tree AddOn, the first thing I did was play with the parameters and wish they could be animated.

So I took a stab at it. I realize that TrumanBlending’s addon is still being developed, but I took his version 0.4 code and popped it into the frame change event architecture and sure enough, we have an animatable parametric tree.

https://vimeo.com/20900713

I am attaching a BLEND file. The AddOn, itself is contained in the text window and is called addon_parm_tree.py. Simply press Play or scrub the timeline to see the effect of the animated tree.

This is the second release of the parametric tree add on. If you pulled down the first version, you may want to try this one again.

The Changes Are:
I integrated TrumanBlending’s v04 code instead of the v03 code. This makes less “Glitchy” trees when parameters are animated.

You can now have multiple animated trees.

Some bounds checking has been put in in place.

Also materials now stick to trees.

Attachments

25_addon_parm_tree_2c.blend (144 KB)

wow… kudos to both of you!

Awesome ideas Atom. It works well too! Just looking at how to minimise memory usage (I noticed there’s another thread for this too) have you tried something like;

bpy.data.curves.remove()

Or for meshes, here’s a complete example assuming you have the default cube in your scene.


import bpy
mesh = bpy.data.meshes['Cube']
mesh.user_clear()
bpy.data.meshes.remove(mesh)

I seem to crash blender with this sometimes, I might need to report it as a bug. I would be more than happy to work with you once the TreeGen script is finalised to make this animation as good as it can be!
Cheers,
Truman

Thanks for curves.remove line of code. That seemed to completely fix the memory leak!

The non-memory leaky version of this code is now attached on the first post, version 1e.

I made a few updates to the Parametric Tree AddOn.

See first post.

Thanks atom, Awesome addition to Trumans trees, Now I go animate me a forest :stuck_out_tongue:

Hi Atom, just been testing this script with a recent SVN, the counter / framechange seems to be happening, but none of the parametric controls seem to make any change to the tree… I don’t suppose you’ve used this script recently?

cheers

Chris

Yep, that will crash blender and is not a bug.

The problem is that the mesh is still linked to an object which is why .remove() fails (won’t delete a mesh with user_count > 0) so you end up with blender trying to dereference a null pointer which is never good.

You should never use .user_clear() unless your intention is to crash blender.