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

Hi All,

I offer up my parametric torus addon.

Yes, a truly parametric object that is generated on the fly whenever the frame changes. Yes, you can animate the inner and outer radius parameters. The object parameters show up in the Custom Properties panel in the object sub-context.

I offer it up as code example on what can be done with using the frame change event addon architecture.

Open the attached BLEND file and press Play.

To install the AddOn into your system simply save the text document addon_parm_torus.py (which is contained within the BLEND file) into your addons folder and then activate it in the User Preferences dialog. The object shows up in the View3D > Add > Mesh SHIFT-A menu.

This code uses the twisted torus generator from Paulo Gomes’ twisted torus addon.

Fourth Update Release!

Attachments

25_parm_torus_addon_1h.blend (172 KB)

i can see the radius in green with driver
and when moving the frame bar it changes

now i don’t even need to start the script cause of the driver i guess!

but a soon as i change one of the other parameters below in object panel it stops working

any idea why ?

thanks

More than likely, you set the segments to 0 this causes the update to crash. If you keep the segments positive, the script should continue to work.

Ideally, the Custom Properties panel should be replaced with a Properties layout panel. But for the time being I wanted to get the concept of animated properties out there so others could try it out.

thanks atom,
now there’s a great chance to do all the objects this way :wink:

Yes,

I am beginning to think that the frameChange event can actually function as a python based modifier for objects.

is this sort of like the built modifier?

but control with frame’s number instead !

happy 2.5

I have worked on the Parametric Torus a bit.

Here is the update:

It works with a mesh material now. You can only have one material per torus, but the material does get transferred to the newly generated mesh every frame.

Better scene recovery if script or empty are accidentally erased from the scene. Simply add another Parametric Torus to the scene and it will be restored.

Added bounding to the values in the Custom Properties. This should prevent crashing due to invalid parameters being passed to the generator.

Added the ‘Twist’ parameter from Paulo Gomes’ original script as an additional property you can animate.

Multiple Tori (is that the plural?) are now possible. You can have more than one parametric mesh in the scene now.

These fixes are incorporated into the version 1f release available at the top of this post.

Also, hopefully, a final render bug fix on version 1h.

are there some variables you can change like for the twist angle
or others

i can change the frame but how do you control the effect or cannot be done !

thanks

Just animate the custom properties of the PARM_torus_ object as you would any other parameters.

I did add the twist property back into the mesh generator.

NOTE: To see the mesh update after you make a property change, you do have to move to another frame.