INTRODUCTION

Polygroup Maker is a script for the Blender 3D modeling software writed in Python, by Christophe Leblanc, in 2018.

This script helps graphists and developers to create and manipulate one or several groups of cloned objects positioned like a polygon or a circle around a center point.

Creating and manipulating such a group is a recurring task that can be very boring and particularly repetitive, so the purpose of this script is to make it easy. This version manages all possible regular polygons from three points to one hundred points.

FEATURES

In details:

  • Add a control panel in the object property space.
  • Convert an object* in a polygroup.
  • Choose the number of clones composing the polygroup.
  • Resize the polygroup.
  • Scale and rotate the group children.
  • Keep the group children rotation tracking the center or not (like a "Track To" constraint).
  • Compatible with animations.
  • Add/create a material to the group, or delete the materials if there are ones.
  • One-click destruction and cancelation

User interface:

This script add a panel in the object property space to control its functionnalities. This panel is displayed differently depending on the active object.

Blender compatibility:

Fully tested in:

  • Blender 2.79 (Windows & Linux)
  • Blender 2.76 (Windows & Linux)

TECHNICAL INFORMATIONS

Python:

This script is coded in Python, the programmation language used in Blender to communicate with the API and develop addons.

2D/3D:

Actually, this script can only manages 2D polygons in a 3D environment, it can only calculate points positioned on a 2D plane. However, this plane may itself be rotated on three axes. The children objects of the group can be rotated or scaled and the group itself keep the tranformation properties of any Blender object (Translation, Rotation, Scale).

Polygroup:

It is necessary to differentiate the node serving as polygroup in the blender context, and the polygroup itself. The basic idea of a "Polygroup" is an ensemble of clones inside a common entity. The best implementation of this in Blender is to use an empty parent node (type "EMPTY"), which can contain the children of the polygroup. Notice that with this implementation, an user could add an objet in the parent group that is external to the polygroup. This case is managed by the script to prevent troubles. So, all the children in the polygroup are children of the parent, but not all the children in the parent are children of the polygroup.

Generating:

The generating process of a polygroup is as follows: At start, the required values of the polygon are calculated. On second step, a new empty object is created at the same position as the source object. Then, the source object is cloned and the clones positioned according to the calculated values. Finally, the source object is removed from the scene.

Real time and animation processing:

This run in real time and is fully compatible with the blender animation system. Each polygroup property can be easily animated with keyframes. So using polygroups in movies or any other images sequences is possible.

Scaling and rotating children:

The scale and rotation vectors visible in the panel are just transmitted as is to the children, except if the "tracking center" option is enabled. In this case, the rotation vector visible in the panel is added to the one calculated.

Tracking calculation:

The rotation angle of each child is calculated by the script. This is not done by any added constraints.

Objects compatibility:

Only the primitive meshes are compatible for now. A new compatibility for type "LIGHT" will be added sooner.

Materials:

Some versions of this script include special "Material" functionnalities that allow the user to add or remove a material to all the children.

HOW TO USE

Use the PolyGroup Maker:

Copy the script or load the ".py" file in the Blender text editor, then click on "Run Script". The script panel will appear in the active object property panel.

Generate a polygroup:

Select a compatible object, change options if needed and click on "Generate".

Recover the source object:

Select a polygroup and click on "Cancel"

Destroy a polygroup:

Select a polygroup and click on "Destroy"

LICENSE

This program is free software, you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

DOWNLOAD

RELATED

Creative Commons License

This document by Christophe Leblanc is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.