[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [988] trunk/py/scripts/addons/ add_mesh_pipe_joint.py: * Version 0.10.6 - Made PEP8 compatible again.
Martin Buerbaum
martin.buerbaum at gmx.at
Mon Sep 6 16:10:39 CEST 2010
Revision: 988
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=988
Author: pontiac
Date: 2010-09-06 16:10:38 +0200 (Mon, 06 Sep 2010)
Log Message:
-----------
* Version 0.10.6 - Made PEP8 compatible again.
* Some minor formatting
* Synced with my local copy.
Modified Paths:
--------------
trunk/py/scripts/addons/add_mesh_pipe_joint.py
Modified: trunk/py/scripts/addons/add_mesh_pipe_joint.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_pipe_joint.py 2010-09-06 12:28:45 UTC (rev 987)
+++ trunk/py/scripts/addons/add_mesh_pipe_joint.py 2010-09-06 14:10:38 UTC (rev 988)
@@ -19,7 +19,7 @@
bl_addon_info = {
"name": "Pipe Joints",
"author": "Buerbaum Martin (Pontiac)",
- "version": (0,10,5),
+ "version": (0, 10, 6),
"blender": (2, 5, 3),
"api": 31667,
"location": "View3D > Add > Mesh > Pipe Joint",
@@ -42,6 +42,14 @@
Note: Currently only the "Elbow" type supports odd number of vertices.
Version history:
+v0.10.6 - Removed "recall properties" from all functions.
+ Updated various code for new API.
+ API: mathutils.RotationMatrix -> mathutils.Matrix.Rotation
+ API: xxx.selected -> xxx.select
+ API: "invoke" function for each operator.
+ Updated for new bl_addon_info structure.
+ New code for the "align_matrix".
+ made script PEP8 compatible.
v0.10.5 - createFaces can now create fan/star like faces.
v0.10.4 - Updated the function "createFaces" a bit. No functional changes.
v0.10.3 - Updated store_recall_properties, apply_object_align
@@ -136,11 +144,14 @@
obj_align = context.user_preferences.edit.object_align
if (context.space_data.type == 'VIEW_3D'
and obj_align == 'VIEW'):
- rot = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ view_mat = context.space_data.region_3d.view_matrix
+ rot = view_mat.rotation_part().invert().resize4x4()
else:
rot = mathutils.Matrix()
align_matrix = loc * rot
return align_matrix
+
+
# Create a new mesh (object) from verts/edges/faces.
# verts/edges/faces ... List of vertices/edges/faces for the
# new mesh (as used in from_pydata).
@@ -403,6 +414,7 @@
obj = create_mesh_object(context, verts, [], faces,
"Elbow Joint", edit, self.align_matrix)
+
return {'FINISHED'}
def invoke(self, context, event):
@@ -410,6 +422,7 @@
self.execute(context)
return {'FINISHED'}
+
class AddTeeJoint(bpy.types.Operator):
# Create the vertices and polygons for a simple tee (T) joint.
# The base arm of the T can be positioned in an angle if needed though.
@@ -592,7 +605,8 @@
faces.extend(createFaces(loopJoint2, loopArm, closed=True))
faces.extend(createFaces(loopJoint3, loopMainEnd, closed=True))
- obj = create_mesh_object(context, verts, [], faces, "Tee Joint", edit, self.align_matrix)
+ obj = create_mesh_object(context, verts, [], faces,
+ "Tee Joint", edit, self.align_matrix)
return {'FINISHED'}
@@ -601,6 +615,7 @@
self.execute(context)
return {'FINISHED'}
+
class AddWyeJoint(bpy.types.Operator):
'''Add a Wye-Joint mesh'''
bl_idname = "mesh.primitive_wye_joint_add"
@@ -798,7 +813,8 @@
faces.extend(createFaces(loopJoint2, loopArm1, closed=True))
faces.extend(createFaces(loopJoint3, loopArm2, closed=True))
- obj = create_mesh_object(context, verts, [], faces, "Wye Joint", edit, self.align_matrix)
+ obj = create_mesh_object(context, verts, [], faces,
+ "Wye Joint", edit, self.align_matrix)
return {'FINISHED'}
@@ -807,6 +823,7 @@
self.execute(context)
return {'FINISHED'}
+
class AddCrossJoint(bpy.types.Operator):
'''Add a Cross-Joint mesh'''
# Create the vertices and polygons for a coss (+ or X) pipe joint.
@@ -1075,6 +1092,7 @@
self.execute(context)
return {'FINISHED'}
+
class AddNJoint(bpy.types.Operator):
'''Add a N-Joint mesh'''
# Create the vertices and polygons for a regular n-joint.
@@ -1235,7 +1253,8 @@
createFaces(loopsJoints[loopIdx],
loopsEndCircles[loopIdx], closed=True))
- obj = create_mesh_object(context, verts, [], faces, "N Joint", edit, self.align_matrix)
+ obj = create_mesh_object(context, verts, [], faces,
+ "N Joint", edit, self.align_matrix)
return {'FINISHED'}
@@ -1244,6 +1263,7 @@
self.execute(context)
return {'FINISHED'}
+
class INFO_MT_mesh_pipe_joints_add(bpy.types.Menu):
# Define the "Pipe Joints" menu
bl_idname = "INFO_MT_mesh_pipe_joints_add"
@@ -1267,6 +1287,7 @@
import space_info
+
# Define "Pipe Joints" menu
def menu_func(self, context):
self.layout.menu("INFO_MT_mesh_pipe_joints_add", icon="PLUGIN")
More information about the Bf-extensions-cvs
mailing list