bpy.data.objects.new expects a name and a mesh object (not ‘MESH’ anymore - this was a change in the API).
I suggest you use tuples “()” instead of lists “[]” for the vertices.
It works either way, but there are always 3 of them and () is used for a fixed number of entries. See also http://news.e-scribe.com/397
Faces can have 3 or 4 (or in the future maybe even more) entries, so lists work fine for that
The problem was that I’m using Alpha2. I first tried it the same way you did it in your script and got an error telling me to put a “type”. I downloaded now a fresh build, and it worked fine.
About tuples, I knew they were faster but didn’t use them at all. It’ll be good to take them more into account and get things running faster when they are appropriate.
Yes, the API changed in between.
This is to be expected in development this rapid
Speed is not the reason I suggest to use tuples for the vertex coordinates (np idea how much the performace hit actually is - probably pretty tiny for most applications.)
The reason is that you have a list with exactly 3 entries - always.
In tuples you can rely on this fact, in lists you can not. [1]
Martin
[1] All of this is from my current knowledge of python. No guarantee that I’m right
I’ve created a videotutorial about your addon yesterday. It’s in german, though.
I hope I pronounced your name correctly.
You can watch the tutorial on Youtube by typing in “BlenderEi” as the user name(can’t post links here).
Do you think you will keep updating the addon? That’d be awesome. Is it possible to convert the addon into a modifier? With an animatable ‘time-Variable’ for example? It’s a pity that your addon works destructable
I also noticed that in the XYZ-Function Surface points are not set to U-max and V-max respectively, because the loop in you script seems to start placing points from zero to the maximum - is this supposed to be like that? This is the only way, right?
All in all a really great tool. Helped me understanding maths pretty good.
Well, the addon is now in the blender-extension repository and is constantly updated (either by my of other blender python programmers).
I don’t update this thread as often because of this. You can still post here (or in the tracker for the script) to comment and report bugs respectively.
I have no plans to make this into a modifier (mostly for lack of skill and time), sorry. Would be pretty nice, and that’s also what I initially tried to do.
The script was non-destructible for some time, but the way it was done was not very good.
Short summary on the “why”:
A generic system/framework to re-create meshes even after performing a non-destructive action would be the saner solution. At least in comparison with the rather hack-ish python code I used for some time.
It’s definitely something I’d like to have for a script like this, since the parameters can get pretty complicated. Time will tell I guess, it would need some blender internal changes to make it work.
I do not know much about the code in the x,y,z script because I reuse a lot of code from a previous script (by Ed Mackey & tuga3d). I simply modified it to work in blender 2.5x. [“pi” suggestion deleted, nevermind]
I’ll try to investigate this and find a fix (time permitted).
Cheers,
Martin
EDIT: I just saw that your input fields are sorted in a rather confusing way, I’d even say the look random.
What version of the script and blender are you using?
In the most recent version it should look something like this:
Z Function Surface
* Z Equation
* X Subdivisions
* Y Subdivisions
* X Size
* Y Size
X,Y,Z Function Surface
* X Equation
* Y Equation
* Z Equation
* U min
* U max
* U step
* U wrap
* V min
* V max
* V step
* V wrap
So you’re also german, eh? Now I noticed that you’re from vienna
Also thanks for publishing the links. I assume that I can’t post links due to my first postings in the BlenderArtist board (i just joined two days ago). There is still this annoying error message, when I click “Preview Post”:
Ah, sure. Forgot about the fact, that there is the SVN Repository. That’s great. If I notice something weird about the addon, I will post it in the tracker. But since you fixed the input fields and the umax and vmax bug, this probably won’t happen.
Now that’s cool. I agree with you, that hopefully soon with a stable Blender Python API there will be a chance of implementing your great addon as a modifier.
If I can improve upon something, don’t hesitate to tell me - I can cope with critique and I even want it
Alright… …now comes the embarrasing part. :o I’m still using Blender 2.53.1, Revision 31745. I will now go and update Blender - I promise! Thanks for releasing a newer version of your addon so rapidly. You are great!
Wish you all the best and please keep on producing these great tools for our Blender 3D
See you,
Adam
Thank you for your great introduction video, BlenderEi and thank you pontiac for all the good work on the script
I have very high hopes on this plugin. It could be usefull both for creating marvelous looking plots and animated functions as background for mograph stuff…
He he, even your quoted URLs get ‘censored’ right now
Yeah, I guess this will be corrected once you have been authorised by a moderator or something like that.
I edited out a suggestion concerning the umax bug, but a second later I realised that it does not work :o
That’s no thing to be embarrassed for. Especially with the fast development of v2.5x Blender. I myself can only keep up because I compile blender myself and can thus always keep up-to-date fairly easy.
Even then it’s going pretty fast
I see you still have code referencing the magic “edit” property. Did you know that’s not necessary any more? You can simply create a new object each time your “execute” method is called, and Blender will take care of getting rid of the old one.
The script refuses to be activated with the command line notice:
File “/home/julian/sources/Blender_2.5_debug/install/linux2/2.58/scripts/modules/addon_utils.py”, line 219, in enable
mod.register()
AttributeError: ‘module’ object has no attribute ‘register’