UPDATE 2011-06-26
This script has been integrated into the “Extra Objects” Add-On already included into Blender.
Simply activate that script and you are good to go. Add -> Extra Objects -> Math Function
Old Post content:
Had some time to play around with mesh creation code again.
This script lets the user create a (mesh) surface where the z coordinate is a function of the x and y coordinates.
z = f(x,y)
Blender 2.5x Link to the script
(Save the “Raw data blob” link there as a file into your .blender/scripts/addons/ directory)
You can then enable the plugin in the User Preferences under Add-Ons.
Hi, script looks great, I have been trying to program a script for 2.49 but have found it quite difficult, how have you found it writing this for 2.5? Easier? How did you learn? any resources you can share?
@mandoragon
The text below assumes you already know hwo to use Python…
To me programming for 2.49 is roughly the same “difficulty level” as programming for 2.5.
But 2.5 has some nice new feature and concepts that help with streamlining the process a bit (but it also has some unfinished stuff of course).
I mainly use the following resources (most of them are referred to in this forum in various places):
Existing scripts. These are very useful to get started.
It may look close, but it’s something quite different internally.
I’m actually creating new geometry each time the equation is changed (or rather: Blender does) - there is no modification of geometry.
I doubt the code (except for the equation/formula evaluation part) can be used for a wave-like modifier.
Unless of course instead of making a new vertex, at initialisation you could make an array of vertex the size and resolution of the mesh and have a loop assigning them depending on the function? that would also allow you to have it change with time
I use git, not svn
Gitorious had the easiest account setup/usage from the 2 or 3 git hosts I tried. I used it since I created my account.
That also means, that I can’t really say if other hosts do anything better or worse than gitorious. I don’t know them as well.
One of them was http://github.com/, I don’t really remember the other one(s), sorry.
I guess searching the web will probably return it/them among others.
As far as I’m concerned the script is done - unless there are any bugs I didn’t find yet.
EDIT: That said, I just saw that I didn’t upload the most recent code here (some security stuff for the eval function).
Updated version post follows in a minute.
Hm, I’m pretty sure this isn’t possible with the current way the script asks for the equation text.
I’d need to actually create a GUI that calls the operator which then could display/define the presets. Even then you can only use the presets when creating the geoemtry the first time - but now when re-doing.
For now this is too much work for little benefit IMO, but I’ll look into this anyway.