Py-ParametricTools is a very simple approach to parametric modeling. Based on an idea of my friend Noseman, Py-ParametricTools basically consist of a bunch of generator and modifier objects for a number of commonly used modeling tools. Nothing fancy and easily done in Python, we thought this could still be helpful for some users out there.
There are generators and modifiers for the following modeling tools:
- Extrude Inner
- Normal Move
- Normal Scale
- Normal Rotate
- Reverse Normals
- Smooth Shift
The generators and modifiers are used like all the others in Cinema 4D. Generators get parented to objects and modifiers are used as children. The parameters are mainly the same as in the respective modeling tools.
For details see our online help here: Extrude, Extrude Inner, Normal Move, Normal Scale, Normal Rotate, Reverse Normals, Smooth Shift.
Of course generators can be stacked.
All modifiers support selections to restrict them to certain polygons, simply drag the selection tags onto the respective field inside a modifier’s parameters.
The Extrude generator (and only the Extrude generator) also supports two “implicit” selections: front and sides, the later only being available if “Create Caps” is not activated. In order to use these simply drag a material onto the Extrude generator and type either name into the Selection parameter of the Texture tag.
New in version 1.3
Thanks to the generous contribution of Andreas Block a new version is available bringing numerous enhancement and Python 3.0 compatibility
- Py-Matrix Extrude Generator/Modifier
- Py-Subdivide Generator/Modifier
- Py-Optimize Generator/Modifier
- Py-Slide Polys Generator/Modifier
- Py-Slide Polys Tool
- Buttons “Create Selection New Polys” and “Create Selection Add Polys” in Py-Extrude Modifier, Py-Matrix Extrude Modifier and Py-Inner Extrude Modifier
A simple tool to slide a polygon in the plane of the polygon.
It is not only available as parametric generator or modifier, but also a modeling tool.
This can for example be useful to offset the center polygon of a inner extrude operation.
There are three modes to set the offset: “Combined Edge Directions”, “Connected Edge Directions”, “Edge Centers”.
If the “Relative” option is set, the offsets are set in percent of the respective edge’s length.
Mode: Combined Edge Directions
The offsets are interpreted in the direction of the edges of a polygon.
See the following screenshot:
The entire polygon will be moved by the sum of all four offsets.
For example this may be useful, if one wants to slide a polygon in the direction of one specific edge.
Mode: Connected Edge Directions
This mode is similar to above described “Combined Edge Directions”. But instead of sliding the entire polygon by the sum of all four offsets, the points P1 to P4 are only influenced by the offsets belonging to the edges they are connected to.
For example the point P1 will be moved by the sum of the offsets X1 and Y2.
A possible use case could be a slight distortion of polygons.
Mode: Edge Centers (default)
The offsets correspond to the direction defined by the centers of the opposing edges of a polygon.
See the following screenshot:
Py-Extrude Modifier, Py-Matrix Extrude Modifier and Py-Inner Extrude Modifier
Buttons “Create Selection New Polys” and “Create Selection Add Polys”
These buttons create a polygon selection tag for use with consecutive Py-Parametric Modifiers.
Create Selection New Polys
The modifier will store either only the newly created polygons in the selection tag.
For example in case of the Py-Extrude Modifier these are the side polygons of the extrude operation.
Create Selection Add Polys
The modifier will will _add_ the newly created polygons to the selection currently in use by the modifier.
For example in case of the Py-Extrude Modifier these are all extruded polygons (sides and cap).
Look at the image “Modifiers restricted to selections” above, where a polygon cube gets deformed by three parametric modifiers, each restricted to a different selection. As long as they have the same polygon count, you could create the polygon selections on a polygonal cube and afterwards drag them to a parametric cube. In this way you have parametric polygon tools deforming only selected polygons of a parametric cube.
One More Note
As said before, this project really is nothing fancy. But for some it may serve as an example, how easily Python can be used to create a parametric workflow for existing tools. It’s also demonstrating how to re-use existing description resources.
Simply unzip the downloaded archive into the plugins folder. There’s a palette file included, which can be simply dragged onto Cinema 4D.
Cinema 4D R16 and higher. May even work with lower versions, but was never tested.
Py-ParametricTools_1.3.0.zip (128.2 KiB)
Unzip the downloaded archive to Cinema 4D’s default plugin folder.
Provide your bug reports, test scenes or ideas by writing an email to labs-at-maxon-dot-net