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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-27 18:24:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-27 18:24:42 +0300
commit39ace717e5ad8ce11f9b1e064ff820e145716368 (patch)
treef3354039ca14257891c1c36c279bf667aaa030bf
parentebd058d7a6438d137522063bb3286c8acc325ca6 (diff)
parent44cbc3d71a2e81b42bb1685825957b0255e8b369 (diff)
Merge branch 'master' into blender2.8
-rw-r--r--add_mesh_BoltFactory/Boltfactory.py66
-rw-r--r--add_mesh_BoltFactory/__init__.py2
-rw-r--r--add_mesh_BoltFactory/createMesh.py130
-rw-r--r--io_blend_utils/blend/blendfile.py4
-rw-r--r--node_wrangler.py4
-rw-r--r--object_print3d_utils/__init__.py9
-rw-r--r--object_print3d_utils/export.py6
-rw-r--r--object_print3d_utils/mesh_helpers.py16
-rw-r--r--object_print3d_utils/operators.py10
-rw-r--r--oscurart_tools/oscurart_meshes.py96
-rw-r--r--presets/operator/mesh.bolt_add/default.py1
-rw-r--r--presets/operator/mesh.bolt_add/m10.py1
-rw-r--r--presets/operator/mesh.bolt_add/m12.py1
-rw-r--r--presets/operator/mesh.bolt_add/m3.py1
-rw-r--r--presets/operator/mesh.bolt_add/m4.py1
-rw-r--r--presets/operator/mesh.bolt_add/m5.py1
-rw-r--r--presets/operator/mesh.bolt_add/m6.py1
-rw-r--r--presets/operator/mesh.bolt_add/m8.py1
18 files changed, 129 insertions, 222 deletions
diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py
index 67e46d8c..672633d3 100644
--- a/add_mesh_BoltFactory/Boltfactory.py
+++ b/add_mesh_BoltFactory/Boltfactory.py
@@ -20,44 +20,29 @@
import bpy
from mathutils import Matrix
from bpy.types import Operator
+from bpy_extras.object_utils import AddObjectHelper
from bpy.props import (
BoolProperty,
EnumProperty,
FloatProperty,
IntProperty,
+ FloatVectorProperty,
)
from . import createMesh
-# ------------------------------------------------------------
-# calculates the matrix for the new object depending on user pref
-def align_matrix(context):
- loc = Matrix.Translation(context.scene.cursor_location)
- 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.to_3x3().inverted().to_4x4()
- else:
- rot = Matrix()
- align_matrix = loc * rot
- return align_matrix
-class add_mesh_bolt(Operator):
+class add_mesh_bolt(Operator, AddObjectHelper):
bl_idname = "mesh.bolt_add"
bl_label = "Add Bolt"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
bl_description = "Construct many types of Bolts"
- align_matrix = Matrix()
+
MAX_INPUT_NUMBER = 50
- # edit - Whether to add or update
- edit = BoolProperty(
- name="",
- description="",
- default=False,
- options={'HIDDEN'}
- )
+
# Model Types
Model_Type_List = [('bf_Model_Bolt', 'BOLT', 'Bolt Model'),
('bf_Model_Nut', 'NUT', 'Nut Model')]
@@ -148,35 +133,35 @@ class add_mesh_bolt(Operator):
)
bf_CounterSink_Head_Dia = FloatProperty(
attr='bf_CounterSink_Head_Dia',
- name='Head Dia', default=5.5,
+ name='Head Dia', default=6.300000190734863,
min=0, soft_min=0,
max=MAX_INPUT_NUMBER,
description='Diameter of the Counter Sink Head'
)
bf_Cap_Head_Height = FloatProperty(
attr='bf_Cap_Head_Height',
- name='Head Height', default=5.5,
+ name='Head Height', default=3,
min=0, soft_min=0,
max=MAX_INPUT_NUMBER,
description='Height of the Cap Head'
)
bf_Cap_Head_Dia = FloatProperty(
attr='bf_Cap_Head_Dia',
- name='Head Dia', default=3,
+ name='Head Dia', default=5.5,
min=0, soft_min=0,
max=MAX_INPUT_NUMBER,
description='Diameter of the Cap Head'
)
bf_Dome_Head_Dia = FloatProperty(
attr='bf_Dome_Head_Dia',
- name='Dome Head Dia', default=5.6,
+ name='Dome Head Dia', default=5.599999904632568,
min=0, soft_min=0,
max=MAX_INPUT_NUMBER,
description='Length of the unthreaded shank'
)
bf_Pan_Head_Dia = FloatProperty(
attr='bf_Pan_Head_Dia',
- name='Pan Head Dia', default=5.6,
+ name='Pan Head Dia', default=5.599999904632568,
min=0, soft_min=0,
max=MAX_INPUT_NUMBER,
description='Diameter of the Pan Head')
@@ -204,7 +189,7 @@ class add_mesh_bolt(Operator):
bf_Pitch = FloatProperty(
attr='bf_Pitch',
- name='Pitch', default=0.35,
+ name='Pitch', default=0.3499999940395355,
min=0.1, soft_min=0.1,
max=7.0,
description='Pitch if the thread'
@@ -239,7 +224,7 @@ class add_mesh_bolt(Operator):
)
bf_Hex_Nut_Height = FloatProperty(
attr='bf_Hex_Nut_Height',
- name='Hex Nut Height', default=2.4,
+ name='Hex Nut Height', default=2.4000000953674316,
min=0, soft_min=0,
max=MAX_INPUT_NUMBER,
description='Height of the Hex Nut'
@@ -251,6 +236,23 @@ class add_mesh_bolt(Operator):
max=MAX_INPUT_NUMBER,
description='Flat distance of the Hex Nut'
)
+
+ # generic transform props
+ view_align = BoolProperty(
+ name="Align to View",
+ default=False,
+ update=AddObjectHelper.view_align_update_callback,
+ )
+
+ location = FloatVectorProperty(
+ name="Location",
+ subtype='TRANSLATION',
+ )
+
+ rotation = FloatVectorProperty(
+ name="Rotation",
+ subtype='EULER',
+ )
def draw(self, context):
layout = self.layout
@@ -309,18 +311,22 @@ class add_mesh_bolt(Operator):
col.prop(self, 'bf_Crest_Percent')
col.prop(self, 'bf_Root_Percent')
col.prop(self, 'bf_Div_Count')
+
+ # generic transform props
+ col.separator()
+ col.prop(self, 'view_align')
+ col.prop(self, 'location')
+ col.prop(self, 'rotation')
@classmethod
def poll(cls, context):
return context.scene is not None
def execute(self, context):
- createMesh.Create_New_Mesh(self, context, self.align_matrix)
+ createMesh.Create_New_Mesh(self, context)
return {'FINISHED'}
def invoke(self, context, event):
- # store creation_matrix
- self.align_matrix = align_matrix(context)
self.execute(context)
return {'FINISHED'}
diff --git a/add_mesh_BoltFactory/__init__.py b/add_mesh_BoltFactory/__init__.py
index d4ad13c1..46d250de 100644
--- a/add_mesh_BoltFactory/__init__.py
+++ b/add_mesh_BoltFactory/__init__.py
@@ -19,7 +19,7 @@
bl_info = {
"name": "BoltFactory",
"author": "Aaron Keith",
- "version": (0, 3, 3),
+ "version": (0, 3, 4),
"blender": (2, 78, 0),
"location": "View3D > Add > Mesh",
"description": "Add a bolt or nut",
diff --git a/add_mesh_BoltFactory/createMesh.py b/add_mesh_BoltFactory/createMesh.py
index a211be2d..31b74179 100644
--- a/add_mesh_BoltFactory/createMesh.py
+++ b/add_mesh_BoltFactory/createMesh.py
@@ -26,6 +26,7 @@ from math import (
tan, radians,
)
from random import triangular
+from bpy_extras.object_utils import AddObjectHelper, object_data_add
NARROW_UI = 180
MAX_INPUT_NUMBER = 50
@@ -69,7 +70,7 @@ Remove Doubles takes a list on Verts and a list of Faces and
removes the doubles, much like Blender does in edit mode.
It doesn’t have the range function but it will round the corrdinates
and remove verts that are very close togther. The function
-is useful because you can perform a “Remove Doubles” with out
+is useful because you can perform a "Remove Doubles" with out
having to enter Edit Mode. Having to enter edit mode has the
disadvantage of not being able to interactively change the properties.
"""
@@ -1964,140 +1965,45 @@ def Bolt_Mesh(props, context):
return Move_Verts_Up_Z(verts, Thread_Height), faces
-# calculates the matrix for the new object
-# depending on user pref
-def align_matrix(context):
- loc = Matrix.Translation(context.scene.cursor_location)
- 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.to_3x3().inverted().to_4x4()
- else:
- rot = 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).
-# name ... Name of the new mesh (& object).
-# edit ... Replace existing mesh data.
-# Note: Using "edit" will destroy/delete existing mesh data.
-def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix):
- scene = context.scene
- obj_act = scene.objects.active
-
- # Can't edit anything, unless we have an active obj.
- if edit and not obj_act:
- return None
-
- # Create new mesh
- mesh = bpy.data.meshes.new(name)
-
- # Make a mesh from a list of verts/edges/faces.
- mesh.from_pydata(verts, edges, faces)
-
- # Fix T51338 : Validate the mesh (the internal thread generator for the Nut
- # should be more reliable now, however there could be other possible errors)
- is_not_mesh_valid = mesh.validate()
-
- if is_not_mesh_valid:
- print("\n[BoltFactory]\nFunction: create_mesh_object\n"
- "Mesh is not Valid, correcting\n")
-
- # Update mesh geometry after adding stuff.
- mesh.update()
-
- # Deselect all objects when in object mode
- if bpy.ops.object.select_all.poll():
- bpy.ops.object.select_all(action='DESELECT')
-
- if edit:
- # Replace geometry of existing object
-
- # Use the active obj and select it.
- ob_new = obj_act
- ob_new.select = True
-
- if obj_act.mode == 'OBJECT':
- # Get existing mesh datablock.
- old_mesh = ob_new.data
-
- # Set object data to nothing
- ob_new.data = None
-
- # Clear users of existing mesh datablock.
- old_mesh.user_clear()
- # Remove old mesh datablock if no users are left.
- if (old_mesh.users == 0):
- bpy.data.meshes.remove(old_mesh)
- # Assign new mesh datablock.
- ob_new.data = mesh
- else:
- # Create new object
- ob_new = bpy.data.objects.new(name, mesh)
-
- # Link new object to the given scene and select it.
- scene.objects.link(ob_new)
- ob_new.select = True
-
- # Place the object at the 3D cursor location.
- # apply viewRotaion
- ob_new.matrix_world = align_matrix
-
- if obj_act and obj_act.mode == 'EDIT':
- if not edit:
- # We are in EditMode, switch to ObjectMode.
- bpy.ops.object.mode_set(mode='OBJECT')
-
- # Select the active object as well.
- obj_act.select = True
- # Apply location of new object.
- scene.update()
-
- # Join new object into the active.
- bpy.ops.object.join()
-
- # Switching back to EditMode.
- bpy.ops.object.mode_set(mode='EDIT')
-
- ob_new = obj_act
-
- else:
- # We are in ObjectMode.
- # Make the new object the active one.
- scene.objects.active = ob_new
- return ob_new
-def Create_New_Mesh(props, context, align_matrix):
+def Create_New_Mesh(props, context):
verts = []
faces = []
- # sMeshName ='' # UNUSED
+ edges = []
sObjName = ''
if props.bf_Model_Type == 'bf_Model_Bolt':
# print('Create Bolt')
verts, faces = Bolt_Mesh(props, context)
- # sMeshName = 'Bolt' # UNUSED
sObjName = 'Bolt'
if props.bf_Model_Type == 'bf_Model_Nut':
# print('Create Nut')
verts, faces = Nut_Mesh(props, context)
- # sMeshName = 'Nut' # UNUSED
sObjName = 'Nut'
verts, faces = RemoveDoubles(verts, faces)
verts = Scale_Mesh_Verts(verts, GLOBAL_SCALE)
- obj = create_mesh_object(context, verts, [], faces, sObjName,
- props.edit, align_matrix)
+ mesh = bpy.data.meshes.new(name=sObjName)
+ mesh.from_pydata(verts, edges, faces)
+
+ # useful for development when the mesh may be invalid.
+ # Fix T51338 : Validate the mesh (the internal thread generator for the Nut
+ # should be more reliable now, however there could be other possible errors)
+ is_not_mesh_valid = mesh.validate()
+
+ if is_not_mesh_valid:
+ print("\n[BoltFactory]\nFunction: create_mesh_object\n"
+ "Mesh is not Valid, correcting\n")
+
+ object_data_add(context, mesh, operator=props)
+
- return obj
diff --git a/io_blend_utils/blend/blendfile.py b/io_blend_utils/blend/blendfile.py
index e471beae..c612cc99 100644
--- a/io_blend_utils/blend/blendfile.py
+++ b/io_blend_utils/blend/blendfile.py
@@ -458,9 +458,9 @@ class BlendFileBlock:
yield from self.get_recursive_iter(
f.dna_name.name_only, path_full, default, None, use_nil, use_str, 0)
- def items_recursive_iter(self):
+ def items_recursive_iter(self, use_nil=True):
for k in self.keys():
- yield from self.get_recursive_iter(k, use_str=False)
+ yield from self.get_recursive_iter(k, use_nil=use_nil, use_str=False)
def get_data_hash(self):
"""
diff --git a/node_wrangler.py b/node_wrangler.py
index 24e096c8..391d4e69 100644
--- a/node_wrangler.py
+++ b/node_wrangler.py
@@ -1162,7 +1162,7 @@ class NWLazyMix(Operator, NWBase):
if event.type == 'MOUSEMOVE':
self.mouse_path.append((event.mouse_region_x, event.mouse_region_y))
- elif event.type == 'RIGHTMOUSE':
+ elif event.type == 'RIGHTMOUSE' and event.value == 'RELEASE':
end_pos = [event.mouse_region_x, event.mouse_region_y]
bpy.types.SpaceNodeEditor.draw_handler_remove(self._handle, 'WINDOW')
@@ -1239,7 +1239,7 @@ class NWLazyConnect(Operator, NWBase):
if event.type == 'MOUSEMOVE':
self.mouse_path.append((event.mouse_region_x, event.mouse_region_y))
- elif event.type == 'RIGHTMOUSE':
+ elif event.type == 'RIGHTMOUSE' and event.value == 'RELEASE':
end_pos = [event.mouse_region_x, event.mouse_region_y]
bpy.types.SpaceNodeEditor.draw_handler_remove(self._handle, 'WINDOW')
diff --git a/object_print3d_utils/__init__.py b/object_print3d_utils/__init__.py
index 26d0c7ef..5ae1d3d6 100644
--- a/object_print3d_utils/__init__.py
+++ b/object_print3d_utils/__init__.py
@@ -24,11 +24,11 @@ bl_info = {
"blender": (2, 79, 0),
"location": "3D View > Toolbox",
"description": "Utilities for 3D printing",
- "warning": "",
"wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
"Scripts/Modeling/PrintToolbox",
"support": 'OFFICIAL',
- "category": "Mesh"}
+ "category": "Mesh",
+ }
if "bpy" in locals():
@@ -153,10 +153,7 @@ class Print3D_Preferences(AddonPreferences):
def draw(self, context):
layout = self.layout
-
- col = layout.column()
- col.label(text="Tab Category:")
- col.prop(self, "category", text="")
+ layout.prop(self, "category")
classes = (
diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py
index 49a33e77..cbb607d2 100644
--- a/object_print3d_utils/export.py
+++ b/object_print3d_utils/export.py
@@ -20,14 +20,16 @@
# Export wrappers and integration with external tools.
-import bpy
import os
+import bpy
+
def image_copy_guess(filepath, objects):
# 'filepath' is the path we are writing to.
import shutil
from bpy_extras import object_utils
+
image = None
for obj in objects:
image = object_utils.object_image_guess(obj)
@@ -168,7 +170,7 @@ def write_mesh(context, info, report_cb):
global_scale=global_scale,
)
else:
- assert(0)
+ assert 0
# for formats that don't support images
if export_format in {'STL', 'PLY'}:
diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py
index e1386b84..a5d5f74f 100644
--- a/object_print3d_utils/mesh_helpers.py
+++ b/object_print3d_utils/mesh_helpers.py
@@ -21,7 +21,6 @@
# Generic helper functions, to be used by any modules.
import bmesh
-import array
def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifiers=False):
@@ -29,7 +28,7 @@ def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifier
Returns a transformed, triangulated copy of the mesh
"""
- assert(obj.type == 'MESH')
+ assert obj.type == 'MESH'
if apply_modifiers and obj.modifiers:
import bpy
@@ -101,18 +100,17 @@ def bmesh_check_self_intersect_object(obj):
returns an array of edge index values.
"""
- import bpy
+ import array
+ import mathutils
if not obj.data.polygons:
return array.array('i', ())
bm = bmesh_copy_from_object(obj, transform=False, triangulate=False)
-
- import mathutils
tree = mathutils.bvhtree.BVHTree.FromBMesh(bm, epsilon=0.00001)
-
overlap = tree.overlap(tree)
faces_error = {i for i_pair in overlap for i in i_pair}
+
return array.array('i', faces_error)
@@ -142,7 +140,7 @@ def bmesh_face_points_random(f, num_points=1, margin=0.05):
def bmesh_check_thick_object(obj, thickness):
-
+ import array
import bpy
# Triangulate
@@ -284,7 +282,7 @@ def object_merge(context, objects):
def face_is_distorted(ele, angle_distort):
no = ele.normal
angle_fn = no.angle
-
+
for loop in ele.loops:
loopno = loop.calc_normal()
@@ -293,5 +291,5 @@ def face_is_distorted(ele, angle_distort):
if angle_fn(loopno, 1000.0) > angle_distort:
return True
-
+
return False
diff --git a/object_print3d_utils/operators.py b/object_print3d_utils/operators.py
index be8c323e..e7ff4713 100644
--- a/object_print3d_utils/operators.py
+++ b/object_print3d_utils/operators.py
@@ -20,8 +20,6 @@
# All Operator
-import array
-
import bpy
from bpy.types import Operator
from bpy.props import (
@@ -131,6 +129,8 @@ class MESH_OT_Print3D_Check_Solid(Operator):
@staticmethod
def main_check(obj, info):
+ import array
+
bm = mesh_helpers.bmesh_copy_from_object(obj, transform=False, triangulate=False)
edges_non_manifold = array.array('i', (i for i, ele in enumerate(bm.edges)
@@ -173,6 +173,8 @@ class MESH_OT_Print3D_Check_Degenerate(Operator):
@staticmethod
def main_check(obj, info):
+ import array
+
scene = bpy.context.scene
print_3d = scene.print_3d
threshold = print_3d.threshold_zero
@@ -201,6 +203,8 @@ class MESH_OT_Print3D_Check_Distorted(Operator):
@staticmethod
def main_check(obj, info):
+ import array
+
scene = bpy.context.scene
print_3d = scene.print_3d
angle_distort = print_3d.angle_distort
@@ -356,7 +360,7 @@ class MESH_OT_Print3D_Clean_Isolated(Operator):
return ele.is_wire
def vert_is_isolated(ele):
- return (not bool(ele.link_edges))
+ return not bool(ele.link_edges)
# --- face
elems_remove = [ele for ele in bm.faces if face_is_isolated(ele)]
diff --git a/oscurart_tools/oscurart_meshes.py b/oscurart_tools/oscurart_meshes.py
index 3282c66a..a31e1a57 100644
--- a/oscurart_tools/oscurart_meshes.py
+++ b/oscurart_tools/oscurart_meshes.py
@@ -348,57 +348,40 @@ class OscObjectToMesh(Operator):
# ----------------------------- OVERLAP UV -------------------------------
-def DefOscOverlapUv(valpresicion):
- inicio = time.time()
- mode = bpy.context.object.mode
- bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-
- rd = valpresicion
- ob = bpy.context.object
- absco = lambda x: (abs(round(x[0], rd)), round(x[1], rd), round(x[2], rd))
- rounder = lambda x: (round(x[0], rd), round(x[1], rd), round(x[2], rd))
-
- # vertice a vertex
- vertvertex = {}
- for vert in ob.data.loops:
- vertvertex.setdefault(vert.vertex_index, []).append(vert.index)
-
- vertexvert = {}
- for vertex in ob.data.loops:
- vertexvert[vertex.index] = vertex.vertex_index
-
- # posicion de cada vertice y cada face
- vertloc = {rounder(vert.co[:]): vert for vert in ob.data.vertices}
- faceloc = {rounder(poly.center[:]): poly for poly in ob.data.polygons}
-
- # relativo de cada vertice y cada face
- verteqind = {vert.index: vertloc.get(
- absco(co),
- vertloc[co]).index for co,
- vert in vertloc.items() if co[0] <= 0}
- polyeq = {face: faceloc.get(
- absco(center),
- faceloc[center]) for center,
- face in faceloc.items() if center[0] <= 0}
-
- # loops in faces
- lif = {poly: [i for i in poly.loop_indices] for poly in ob.data.polygons}
-
- # acomoda
- for l, r in polyeq.items():
- if l.select:
- for lloop in lif[l]:
- for rloop in lif[r]:
- if (verteqind[vertexvert[lloop]] == vertexvert[rloop] and
- ob.data.uv_layers.active.data[rloop].select):
-
- ob.data.uv_layers.active.data[
- lloop].uv = ob.data.uv_layers.active.data[
- rloop].uv
+def DefOscOverlapUv(self,offset,rotate):
+ me = bpy.context.object.data
+ bm = bmesh.from_edit_mesh(me)
+ bm.faces.ensure_lookup_table()
+ faces = [face for face in bm.faces if face.select]
+ uv_layer = bm.loops.layers.uv[bpy.context.object.data.uv_layers.active.name]
+
+ faceDict = {}
+ faceReverse = []
+ bm.select_mode = {'FACE'}
+ for face in faces:
+ bpy.ops.mesh.select_all(action="DESELECT")
+ face.select = True
+ bpy.ops.mesh.select_mirror()
+ faceDict[face.index] = [mirrorface for mirrorface in bm.faces if mirrorface.select][0].index
+ faceReverse.append([mirrorface for mirrorface in bm.faces if mirrorface.select][0])
+
+
- bpy.ops.object.mode_set(mode=mode, toggle=False)
+ for selFace,mirrorFace in faceDict.items():
+ for loop,mirrorLoop in zip(bm.faces[selFace].loops,bm.faces[mirrorFace].loops):
+ mirrorLoop.copy_from(loop)
+ if offset:
+ for loop,mirrorLoop in zip(bm.faces[selFace].loops,bm.faces[mirrorFace].loops):
+ mirrorLoop[uv_layer].uv += Vector((1,0))
+
+
+ #invierto direcciones
+ bmesh.ops.reverse_uvs(bm, faces=[f for f in faceReverse])
+ bmesh.ops.rotate_uvs(bm, faces=[f for f in faceReverse])
+ if rotate:
+ bmesh.ops.rotate_uvs(bm, faces=[f for f in faceReverse])
- print("Time elapsed: %4s seconds" % (time.time() - inicio))
+ bmesh.update_edit_mesh(me)
class OscOverlapUv(Operator):
@@ -413,15 +396,18 @@ class OscOverlapUv(Operator):
return (context.active_object is not None and
context.active_object.type == 'MESH')
- presicion = IntProperty(
- default=4,
- min=1,
- max=10,
- name="precision"
+
+ offset = BoolProperty(
+ default=True,
+ name="Offset"
+ )
+ rotate = BoolProperty(
+ default=False,
+ name="Rotate"
)
def execute(self, context):
- DefOscOverlapUv(self.presicion)
+ DefOscOverlapUv(self,self.offset,self.rotate)
return {'FINISHED'}
diff --git a/presets/operator/mesh.bolt_add/default.py b/presets/operator/mesh.bolt_add/default.py
index 3f7a8629..5c1e33dd 100644
--- a/presets/operator/mesh.bolt_add/default.py
+++ b/presets/operator/mesh.bolt_add/default.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 0.3499999940395355
op.bf_Minor_Dia = 2.6211137771606445
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 2.4000000953674316
op.bf_Hex_Nut_Flat_Distance = 5.5
diff --git a/presets/operator/mesh.bolt_add/m10.py b/presets/operator/mesh.bolt_add/m10.py
index d304195b..b92d009e 100644
--- a/presets/operator/mesh.bolt_add/m10.py
+++ b/presets/operator/mesh.bolt_add/m10.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 1.25
op.bf_Minor_Dia = 8.646835327148438
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 8.0
op.bf_Hex_Nut_Flat_Distance = 17.0
diff --git a/presets/operator/mesh.bolt_add/m12.py b/presets/operator/mesh.bolt_add/m12.py
index 06274964..cbec7589 100644
--- a/presets/operator/mesh.bolt_add/m12.py
+++ b/presets/operator/mesh.bolt_add/m12.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 1.5
op.bf_Minor_Dia = 10.376201629638672
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 10.0
op.bf_Hex_Nut_Flat_Distance = 19.0
diff --git a/presets/operator/mesh.bolt_add/m3.py b/presets/operator/mesh.bolt_add/m3.py
index 3f7a8629..5c1e33dd 100644
--- a/presets/operator/mesh.bolt_add/m3.py
+++ b/presets/operator/mesh.bolt_add/m3.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 0.3499999940395355
op.bf_Minor_Dia = 2.6211137771606445
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 2.4000000953674316
op.bf_Hex_Nut_Flat_Distance = 5.5
diff --git a/presets/operator/mesh.bolt_add/m4.py b/presets/operator/mesh.bolt_add/m4.py
index af17e3aa..a4349c5a 100644
--- a/presets/operator/mesh.bolt_add/m4.py
+++ b/presets/operator/mesh.bolt_add/m4.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 0.5
op.bf_Minor_Dia = 3.4587340354919434
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 3.200000047683716
op.bf_Hex_Nut_Flat_Distance = 7.0
diff --git a/presets/operator/mesh.bolt_add/m5.py b/presets/operator/mesh.bolt_add/m5.py
index 6649ad87..7f53703c 100644
--- a/presets/operator/mesh.bolt_add/m5.py
+++ b/presets/operator/mesh.bolt_add/m5.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 0.5
op.bf_Minor_Dia = 4.458734035491943
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 4.0
op.bf_Hex_Nut_Flat_Distance = 8.0
diff --git a/presets/operator/mesh.bolt_add/m6.py b/presets/operator/mesh.bolt_add/m6.py
index 85a2f9e1..225776be 100644
--- a/presets/operator/mesh.bolt_add/m6.py
+++ b/presets/operator/mesh.bolt_add/m6.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 0.75
op.bf_Minor_Dia = 5.188100814819336
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 5.0
op.bf_Hex_Nut_Flat_Distance = 10.0
diff --git a/presets/operator/mesh.bolt_add/m8.py b/presets/operator/mesh.bolt_add/m8.py
index 7c0e8f82..547cc719 100644
--- a/presets/operator/mesh.bolt_add/m8.py
+++ b/presets/operator/mesh.bolt_add/m8.py
@@ -24,5 +24,6 @@ op.bf_Pitch = 1.0
op.bf_Minor_Dia = 6.917468070983887
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
+op.bf_Div_Count = 36
op.bf_Hex_Nut_Height = 6.5
op.bf_Hex_Nut_Flat_Distance = 13.0