friggog / tree-gen

Procedural generation of tree models in blender
GNU General Public License v3.0
827 stars 74 forks source link

Update tree function #66

Closed marianbasti closed 2 years ago

marianbasti commented 2 years ago

It would be great to have an update function, in order to avoid having to regenerate the whole tree or generate a new one.

samipfjo commented 2 years ago

While I agree this would be an awesome feature, due to the limitations that Blender places on the ways that plugins can store persistent data this is quite challenging.

Some thoughts on feasibility:

I suppose we could pickle the tree object and store it as a temporary file. It would require some serious codebase modification to implement "resuming" generation, though. Were this feature to exist it would probably be disabled by default due to the I/O overhead it would introduce.

I don't think it could be stored in memory for future manipulation, as that would at minimum require the data to be serializable to make it work with the Blender API. Even if it's possible it would be a massive can of worms due to all of the moving parts in TreeGen.

friggog commented 2 years ago

Yeah this raises question both around design (how should the user interact with this setup) and implementation - I think it would require pretty much a total rewrite of the plugin to do things totally differently, just using the same parameterization. I know this makes designing new trees a little painful, but I think realistically this is how it's going to stay unless someone else wants to take on this huge amount of work.

In terms of designing a tree, my recommendation is to turn the levels right down and disable leaves so generation time is low, then work through the parameters for each level in turn and finally enable the leaves. This makes iterating on a design a bit less painful