Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlijenstina <lijenstina@gmail.com>2016-12-30 22:33:05 +0300
committerlijenstina <lijenstina@gmail.com>2016-12-30 22:33:05 +0300
commitc86080a455579a8c770545e33b95513b43e1a43b (patch)
tree6c392b16b914aa3264b373022602e57ad493e7d7 /add_mesh_extra_objects/add_mesh_vertex.py
parentc95e86bcef654c0686d3cf4d52446ff9ff8c819f (diff)
Add mesh extra objects: Update to version 0.3.1
General Pep8 cleanup Removed unused variables and imports Removed a panel from add_empty_as_parent Standardized the property definitions across all the scripts Moved scene props from third_domes_panel_271 to init for proper removal Added a Enum prop for mesh type in teapot Fixed a small issue with Geodesic domes self.reports (problem with value fields message spam) Fixed props names in Geodesic domes Consistent tooltips Reorganized menus: Mechanical Menu including Pipe joints, Mesh gear Added separators
Diffstat (limited to 'add_mesh_extra_objects/add_mesh_vertex.py')
-rw-r--r--add_mesh_extra_objects/add_mesh_vertex.py52
1 files changed, 25 insertions, 27 deletions
diff --git a/add_mesh_extra_objects/add_mesh_vertex.py b/add_mesh_extra_objects/add_mesh_vertex.py
index 10c86657..eac3d742 100644
--- a/add_mesh_extra_objects/add_mesh_vertex.py
+++ b/add_mesh_extra_objects/add_mesh_vertex.py
@@ -1,12 +1,7 @@
# GPL # Originals by meta-androcto, Pablo Vazquez, Liero, Richard Wilks
import bpy
-import bmesh
-from bpy.props import StringProperty, FloatProperty, BoolProperty, FloatVectorProperty
-
- # add the mesh as an object into the scene with this utility module
-from bpy_extras import object_utils
-
+from bpy.types import Operator
def object_origin(width, height, depth):
@@ -14,10 +9,7 @@ def object_origin(width, height, depth):
This function takes inputs and returns vertex and face arrays.
no actual mesh data creation is done here.
"""
-
- verts = [(+0.0, +0.0, +0.0)
- ]
-
+ verts = [(+0.0, +0.0, +0.0)]
faces = []
# apply size
@@ -26,42 +18,45 @@ def object_origin(width, height, depth):
return verts, faces
-class AddVert(bpy.types.Operator):
- '''Add a Single Vertice to Edit Mode'''
+
+class AddVert(Operator):
bl_idname = "mesh.primitive_vert_add"
bl_label = "Single Vert"
+ bl_description = "Add a Single Vertice to Edit Mode"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
mesh = bpy.data.meshes.new("Vert")
mesh.vertices.add(1)
-
+
from bpy_extras import object_utils
object_utils.object_data_add(context, mesh, operator=None)
- bpy.ops.object.mode_set(mode = 'EDIT')
+ bpy.ops.object.mode_set(mode='EDIT')
return {'FINISHED'}
-class AddEmptyVert(bpy.types.Operator):
- '''Add an Object Origin to Edit Mode'''
+
+class AddEmptyVert(Operator):
bl_idname = "mesh.primitive_emptyvert_add"
bl_label = "Empty Object Origin"
+ bl_description = "Add an Object Origin to Edit Mode"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
mesh = bpy.data.meshes.new("Vert")
mesh.vertices.add(1)
-
+
from bpy_extras import object_utils
object_utils.object_data_add(context, mesh, operator=None)
- bpy.ops.object.mode_set(mode = 'EDIT')
+ bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.delete(type='VERT')
return {'FINISHED'}
+
def Add_Symmetrical_Empty():
- bpy.ops.mesh.primitive_plane_add(enter_editmode = True)
+ bpy.ops.mesh.primitive_plane_add(enter_editmode=True)
sempty = bpy.context.object
sempty.name = "SymmEmpty"
@@ -70,16 +65,17 @@ def Add_Symmetrical_Empty():
if (sempty.modifiers and sempty.modifiers['Mirror']):
pass
else:
- bpy.ops.object.modifier_add(type ='MIRROR')
+ bpy.ops.object.modifier_add(type='MIRROR')
# Delete all!
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.select_all(action='TOGGLE')
- bpy.ops.mesh.delete(type ='VERT')
+ bpy.ops.mesh.delete(type='VERT')
+
def Add_Symmetrical_Vert():
- bpy.ops.mesh.primitive_plane_add(enter_editmode = True)
+ bpy.ops.mesh.primitive_plane_add(enter_editmode=True)
sempty = bpy.context.object
sempty.name = "SymmVert"
@@ -88,15 +84,15 @@ def Add_Symmetrical_Vert():
if (sempty.modifiers and sempty.modifiers['Mirror']):
pass
else:
- bpy.ops.object.modifier_add(type ='MIRROR')
+ bpy.ops.object.modifier_add(type='MIRROR')
# Delete all!
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.merge(type='CENTER')
-class AddSymmetricalEmpty(bpy.types.Operator):
+class AddSymmetricalEmpty(Operator):
bl_idname = "mesh.primitive_symmetrical_empty_add"
bl_label = "Add Symmetrical Object Origin"
bl_description = "Object Origin with a Mirror Modifier for symmetrical modeling"
@@ -106,7 +102,7 @@ class AddSymmetricalEmpty(bpy.types.Operator):
layout = self.layout
mirror = bpy.context.object.modifiers['Mirror']
- layout.prop(mirror,'use_clip', text="Use Clipping")
+ layout.prop(mirror, "use_clip", text="Use Clipping")
layout.label("Mirror Axis")
row = layout.row(align=True)
@@ -116,10 +112,11 @@ class AddSymmetricalEmpty(bpy.types.Operator):
def execute(self, context):
Add_Symmetrical_Empty()
+
return {'FINISHED'}
-class AddSymmetricalVert(bpy.types.Operator):
+class AddSymmetricalVert(Operator):
bl_idname = "mesh.primitive_symmetrical_vert_add"
bl_label = "Add Symmetrical Origin & Vert"
bl_description = "Object Origin with a Mirror Modifier for symmetrical modeling"
@@ -129,7 +126,7 @@ class AddSymmetricalVert(bpy.types.Operator):
layout = self.layout
mirror = bpy.context.object.modifiers['Mirror']
- layout.prop(mirror,'use_clip', text="Use Clipping")
+ layout.prop(mirror, "use_clip", text="Use Clipping")
layout.label("Mirror Axis")
row = layout.row(align=True)
@@ -139,4 +136,5 @@ class AddSymmetricalVert(bpy.types.Operator):
def execute(self, context):
Add_Symmetrical_Vert()
+
return {'FINISHED'}