I’m building a gui to allow users to take two separate objects (like two suzannes, for instance) and align them based on their constituent parts. So, you could make any two arbitrary edges collinear on totally separate meshes. Or, any two faces coplanar. Or, you could scale a mesh so that one edge within that mesh is of equal length to an edge in another mesh. Or, slide a portion of a mesh or an object in a direction specified by an edge (vector). You can imagine performing these operations on two separate parts of a single mesh as well.
The key feature of the addon is being able to transform and align separate objects or separate pieces of a mesh based on specified constituent geometry. The way the user specifies which constituent parts the transformations are based on is special as well: the addon doesn’t actually store the specified vertex or edge that the user picks. Instead, it stores the coordinates of that vertex (or the two coords for an edge) only. This way, the user is free to create imagined geometry around which to base a transformation. Or, the user can specify an edge from one mesh, and use that as an axis to rotate an entirely different mesh around. So, the constituent geometry that the user specifies is
-
Not associated with any particular mesh. This is intentional. It gives you the option of transforming a mesh based on its own constituent parts, or of transforming a mesh based on the constituent parts of another mesh.
-
Based on either real or imagined geometry. I’m not storing and remembering an actual vertex from an actual mesh. I’m storing only the coordinates of that vertex. So, the user can specify an edge to be used as an axis in transformations by opening the UI menu, and under “Line:” the user can record point 1 of that line as being the coords of a vertex on a mesh, and point 2 of that line can be a 3D cursor location (or any number of other values).
So, to be clear, I want to store point{x,y,z} + line{ {x,y,z}, {x,y,z} } + plane { {x,y,z}, {x,y,z}, {x,y,z} }, times two. I’m thinking at this point that I will try to store this information as part of a text datablock (because I don’t see a way to store data that isn’t a member of bpy.data or their submembers otherwise) which I can convert back and forth to usable values during calculations at runtime. That’s my current direction, without any real guidance except for the API (which is why I’m asking for suggestions).
http://www.blender.org/documentation/blender_python_api_2_63_14/bpy.types.Text.html#bpy.types.Text
@ni-ki-o-kin
So, would my approach above be a good way to go then? (Storing this data on a new text datablock that I create for my script)