[Bf-extensions-cvs] [356ba50] master: restore ideasman changes and add my own
zeffii
noreply at git.blender.org
Fri Jul 29 12:36:00 CEST 2016
Commit: 356ba5012737340e3221cacd50c5358daa9ccdcf
Author: zeffii
Date: Fri Jul 29 12:35:56 2016 +0200
Branches: master
https://developer.blender.org/rBAC356ba5012737340e3221cacd50c5358daa9ccdcf
restore ideasman changes and add my own
===================================================================
M mesh_tiny_cad/BIX.py
M mesh_tiny_cad/CCEN.py
M mesh_tiny_cad/CFG.py
M mesh_tiny_cad/E2F.py
M mesh_tiny_cad/V2X.py
M mesh_tiny_cad/VTX.py
M mesh_tiny_cad/XALL.py
M mesh_tiny_cad/__init__.py
M mesh_tiny_cad/cad_module.py
===================================================================
diff --git a/mesh_tiny_cad/BIX.py b/mesh_tiny_cad/BIX.py
index 388667d..4f02189 100644
--- a/mesh_tiny_cad/BIX.py
+++ b/mesh_tiny_cad/BIX.py
@@ -1,26 +1,26 @@
-'''
-BEGIN GPL LICENSE BLOCK
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-END GPL LICENCE BLOCK
-'''
import bpy
import bmesh
-from mathutils import geometry
from . import cad_module as cm
@@ -34,7 +34,7 @@ def add_line_to_bisection(self):
bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
- edges = [e for e in bm.edges if (e.select and not e.hide)]
+ edges = [e for e in bm.edges if e.select and not e.hide]
if not len(edges) == 2:
msg = "select two coplanar non parallel edges"
@@ -86,7 +86,7 @@ class TCLineOnBisection(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'}
@classmethod
- def poll(self, context):
+ def poll(cls, context):
obj = context.active_object
return all([obj is not None, obj.type == 'MESH', obj.mode == 'EDIT'])
diff --git a/mesh_tiny_cad/CCEN.py b/mesh_tiny_cad/CCEN.py
index 375f541..a68c51b 100644
--- a/mesh_tiny_cad/CCEN.py
+++ b/mesh_tiny_cad/CCEN.py
@@ -1,22 +1,23 @@
-'''
-BEGIN GPL LICENSE BLOCK
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-END GPL LICENCE BLOCK
-'''
import math
@@ -28,7 +29,6 @@ from mathutils import Vector
def generate_bmesh_repr(p1, v1, axis, num_verts):
-
'''
p1: center of circle (local coordinates)
v1: first vertex of circle in (local coordinates)
@@ -69,10 +69,8 @@ def generate_bmesh_repr(p1, v1, axis, num_verts):
def generate_3PT(pts, obj, nv, mode=1):
- origin = obj.location
mw = obj.matrix_world
V = Vector
-
nv = max(3, nv)
# construction
@@ -104,9 +102,6 @@ def generate_3PT(pts, obj, nv, mode=1):
print('not on a circle')
-''' Shared Utils '''
-
-
def get_three_verts_from_selection(obj):
me = obj.data
bm = bmesh.from_edit_mesh(me)
@@ -124,9 +119,8 @@ def dispatch(context, mode=0):
props = context.scene.tinycad_props
generate_3PT(pts, obj, props.num_verts, mode)
except:
- print('oops, dispatch failed', mode)
+ print('dispatch failed', mode)
-''' Operators '''
class TCCallBackCCEN(bpy.types.Operator):
bl_idname = 'tinycad.reset_circlescale'
@@ -154,7 +148,6 @@ class TCCircleCenter(bpy.types.Operator):
row.prop(scn.tinycad_props, 'rescale', text='rescale')
row.operator('tinycad.reset_circlescale', text="", icon="LINK")
-
@classmethod
def poll(cls, context):
obj = context.edit_object
diff --git a/mesh_tiny_cad/CFG.py b/mesh_tiny_cad/CFG.py
index ddd2630..6b2508f 100644
--- a/mesh_tiny_cad/CFG.py
+++ b/mesh_tiny_cad/CFG.py
@@ -1,5 +1,26 @@
-import bpy
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+
import os
+import bpy
ICONS = 'BIX CCEN V2X VTX XALL E2F'.split(' ')
icon_collection = {}
@@ -23,7 +44,6 @@ class VIEW3D_MT_edit_mesh_tinycad(bpy.types.Menu):
def poll(cls, context):
return bool(context.object)
-
def draw(self, context):
pcoll = icon_collection["main"]
diff --git a/mesh_tiny_cad/E2F.py b/mesh_tiny_cad/E2F.py
index 1a650d9..984d503 100644
--- a/mesh_tiny_cad/E2F.py
+++ b/mesh_tiny_cad/E2F.py
@@ -1,22 +1,23 @@
-'''
-BEGIN GPL LICENSE BLOCK
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-END GPL LICENCE BLOCK
-'''
import bpy
import bmesh
@@ -53,7 +54,7 @@ def extend_vertex(self):
failure_message(self)
return
- (v1_ref, v1_idx, v1), (v2_ref, v2_idx, v2) = [(i, i.index, i.co) for i in O]
+ (v1_ref, v1), (v2_ref, v2) = [(i, i.co) for i in O]
plane_co = plane.calc_center_median()
plane_no = plane.normal
@@ -77,7 +78,7 @@ class TCEdgeToFace(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'}
@classmethod
- def poll(self, context):
+ def poll(cls, context):
ob = context.object
return all([bool(ob), ob.type == 'MESH', ob.mode == 'EDIT'])
diff --git a/mesh_tiny_cad/V2X.py b/mesh_tiny_cad/V2X.py
index f77a0ec..69eaeb8 100644
--- a/mesh_tiny_cad/V2X.py
+++ b/mesh_tiny_cad/V2X.py
@@ -1,22 +1,23 @@
-'''
-BEGIN GPL LICENSE BLOCK
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list