[SOLVED] Question about parametric add-ons in Blender

Hello everybody,

I was using the Archimesh add-on and started to think about parametric add-ons in Blender. As it is well-known, this kind of add-ons you can tweak different parameters for creating objects to your needs (doors, windows, etc.), have one issue: once you do anything that will display new information in the Operator panel, you won’t be able to tweak the parameters anymore. I was wondering, why does this happen? and could it be any work around for it? I suppose that it has something to do with applying “all the object information” before making it available for manipulation.

I just think that it’s useful to learn the logic behind how the software works, so if anyone would be so kind to explain roughly what’s happening under the hood, it’ll be much appreciated.

(Sorry if it’s a dumb question)

I have written several parametric model generation AddOns. I think the reason we don’t see more is because when someone starts of scripting they start in the Tool panel instead of the Object panel. So the programmer starts staking up a few commands like make box, extrude etc… till they have a tool that builds their super box. But that approach to scripting is like building a house of cards. You stack one command on top of another kind of like macros in other applications. However, if one mis-step occurs or the context changes the next command will fail.

To build a truly parametric object you have to use commands that do not rely on the context being fixed or set. This requires a little more in depth knowledge of the bpy.data structure.

It really does depend upon your workflow or the requirements for the shot/animation. Is there any difference between scaling a sphere or increasing it’s radius? Also parametric objects that actually increase or change their vertices over time can not effectively be weight painted or UV mapped unless the script does that as well as generate the geometry. Once again which approach you use depends upon the animation requirements.

The Cinema4D Mograph system often requires that a parametric source object be converted to a “fixed” mesh before certain operations can be performed. So I don’t think Blender is that far off track compared to professional software.

If you are referring to the operator panel:

These are just arguments for the active operator instance. Changing these arguments causes an undo and afterwards the operator will run its execute method again with the new arguments given.

So this might be kind of destructive since the mesh gets deleted and rebuild completely however this only requires the code to build an object and in case different arguments require different mesh topologies it often does not make sense to change the existing mesh.

You would also have to store extra informations or parse the mesh again before you can change it.

You could tag your parametric objects using custom properties and define your own panel and set of operators to change these objects. This should be no problem.

The only thing i don’t know is wether there is a convenient way to check wether the user has altered the geometry.

Thanks @Atom and @pink vertex for your reply. I didn’t think about weight paint and UV Mapping, it makes a lot of sense to me now.

Now that I re-think about it, this add-ons follow the logic of most of operations in blender: When you add, lets say a UV sphere, or when you use a tool like Subdivide or Loop cut, you can tweak parameters, but once you do another operation, you can’t tweak the parameters anymore.

I don’t think it’s a big deal, using these add-ons to create a base mesh and then manually modifying it to your needs it’s still great, and I see how it could be much complicated to do a parametric add-on with this reversible nature.

Oh, @Atom, regarding other software, I didn’t mean to imply Blender was lacking some basic feature I would expect from profession software. I think Blender it’s powerful and professional software, and it has its own unique advantages.

Again thank you guys.