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:
authorAaron Keith <aaroninusa@gmail.com>2018-12-13 11:12:46 +0300
committerAaron Keith <aaroninusa@gmail.com>2018-12-13 11:12:46 +0300
commit4de32a8d7c1b494e9cfd93f87d97477a26d8a55e (patch)
treec5b7c5943175c5333bdb1a976a6590e87b573ce6 /add_mesh_BoltFactory
parente4f4053de64eaa04b0199eea8f55a5f6b8b456dd (diff)
BoltFactory (0,4,0)
Now works with Blender 2.8
Diffstat (limited to 'add_mesh_BoltFactory')
-rw-r--r--add_mesh_BoltFactory/Boltfactory.py26
-rw-r--r--add_mesh_BoltFactory/__init__.py17
-rw-r--r--add_mesh_BoltFactory/createMesh.py2
3 files changed, 32 insertions, 13 deletions
diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py
index 25d90706..0b405f3c 100644
--- a/add_mesh_BoltFactory/Boltfactory.py
+++ b/add_mesh_BoltFactory/Boltfactory.py
@@ -330,3 +330,29 @@ class add_mesh_bolt(Operator, AddObjectHelper):
self.execute(context)
return {'FINISHED'}
+
+# Register:
+def menu_func_bolt(self, context):
+ self.layout.operator(
+ add_mesh_bolt.bl_idname,
+ text="Bolt",
+ icon="MOD_SCREW")
+
+classes = (
+ add_mesh_bolt,
+)
+
+
+
+def register():
+ from bpy.utils import register_class
+ for cls in classes:
+ register_class(cls)
+ bpy.types.VIEW3D_MT_mesh_add.append(menu_func_bolt)
+
+
+def unregister():
+ from bpy.utils import unregister_class
+ for cls in reversed(classes):
+ unregister_class(cls)
+ bpy.types.VIEW3D_MT_mesh_add.remove(menu_func_bolt) \ No newline at end of file
diff --git a/add_mesh_BoltFactory/__init__.py b/add_mesh_BoltFactory/__init__.py
index d441a0e8..383ddc36 100644
--- a/add_mesh_BoltFactory/__init__.py
+++ b/add_mesh_BoltFactory/__init__.py
@@ -19,8 +19,8 @@
bl_info = {
"name": "BoltFactory",
"author": "Aaron Keith",
- "version": (0, 3, 4),
- "blender": (2, 78, 0),
+ "version": (0, 4, 0),
+ "blender": (2, 80, 0),
"location": "View3D > Add > Mesh",
"description": "Add a bolt or nut",
"wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
@@ -42,22 +42,15 @@ import bpy
# ### REGISTER ###
-def add_mesh_bolt_button(self, context):
- self.layout.operator(Boltfactory.add_mesh_bolt.bl_idname, text="Bolt", icon="MOD_SCREW")
def register():
- bpy.utils.register_module(__name__)
-
- bpy.types.VIEW3D_MT_mesh_add.append(add_mesh_bolt_button)
- # bpy.types.VIEW3D_PT_tools_objectmode.prepend(add_mesh_bolt_button) # just for testing
+ Boltfactory.register()
+
def unregister():
- bpy.utils.unregister_module(__name__)
-
- bpy.types.VIEW3D_MT_mesh_add.remove(add_mesh_bolt_button)
- # bpy.types.VIEW3D_PT_tools_objectmode.remove(add_mesh_bolt_button) # just for testing
+ Boltfactory.unregister()
if __name__ == "__main__":
diff --git a/add_mesh_BoltFactory/createMesh.py b/add_mesh_BoltFactory/createMesh.py
index c59c9939..71f22bf7 100644
--- a/add_mesh_BoltFactory/createMesh.py
+++ b/add_mesh_BoltFactory/createMesh.py
@@ -169,7 +169,7 @@ def Get_Phillips_Bit_Height(Bit_Dia):
# Returns a list of verts rotated by the given matrix. Used by SpinDup
def Rot_Mesh(verts, matrix):
from mathutils import Vector
- return [(matrix * Vector(v))[:] for v in verts]
+ return [(matrix @ Vector(v))[:] for v in verts]
# Returns a list of faces that has there index incremented by offset