Skip to content

Commit

Permalink
remove local presets folder & replace with internal operator presets
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-androcto committed May 24, 2015
1 parent 6fccd8c commit 14cafb6
Show file tree
Hide file tree
Showing 17 changed files with 209 additions and 234 deletions.
30 changes: 1 addition & 29 deletions add_mesh_BoltFactory/Boltfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
import mathutils
from bpy.props import *
from add_mesh_BoltFactory.createMesh import *
from add_mesh_BoltFactory.preset_utils import *



##------------------------------------------------------------
# calculates the matrix for the new object
Expand Down Expand Up @@ -203,24 +200,12 @@ class add_mesh_bolt(bpy.types.Operator):
min = 0, soft_min = 0, max = MAX_INPUT_NUMBER,
description='Flat distance of the Hex Nut')

presets, presetsPath = getPresets()

bf_presets = EnumProperty(attr='bf_presets',
name='Preset',
description="Use Preset from File",
default='M3.py',
items=presets)

last_preset = None


def draw(self, context):
layout = self.layout
col = layout.column()

#ENUMS
col.prop(self, 'bf_Model_Type')
col.prop(self, 'bf_presets')
col.separator()

#Bit
Expand Down Expand Up @@ -284,21 +269,8 @@ def poll(cls, context):
def execute(self, context):

#print('EXECUTING...')

if not self.last_preset or self.bf_presets != self.last_preset:
#print('setting Preset', self.bf_presets)
setProps(self, self.bf_presets, self.presetsPath)
self.bf_Phillips_Bit_Depth = float(Get_Phillips_Bit_Height(self.bf_Philips_Bit_Dia))

self.last_preset = self.bf_presets


#self.bf_Phillips_Bit_Depth = float(Get_Phillips_Bit_Height(self.bf_Philips_Bit_Dia))
#self.bf_Philips_Bit_Dia = self.bf_Pan_Head_Dia*(1.82/5.6)
#self.bf_Minor_Dia = self.bf_Major_Dia - (1.082532 * self.bf_Pitch)

self.bf_Phillips_Bit_Depth = float(Get_Phillips_Bit_Height(self.bf_Philips_Bit_Dia))
Create_New_Mesh(self, context, self.align_matrix)

return {'FINISHED'}

##### INVOKE #####
Expand Down
51 changes: 0 additions & 51 deletions add_mesh_BoltFactory/preset_utils.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M10.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M12.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M3.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M4.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M5.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M6.py

This file was deleted.

22 changes: 0 additions & 22 deletions add_mesh_BoltFactory/presets/M8.py

This file was deleted.

26 changes: 26 additions & 0 deletions presets/operator/mesh.bolt_add/default.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import bpy
op = bpy.context.active_operator

op.bf_Model_Type = 'bf_Model_Bolt'
op.bf_Head_Type = 'bf_Head_Hex'
op.bf_Bit_Type = 'bf_Bit_None'
op.bf_Nut_Type = 'bf_Nut_Hex'
op.bf_Shank_Length = 0.0
op.bf_Shank_Dia = 3.0
op.bf_Allen_Bit_Depth = 1.5
op.bf_Allen_Bit_Flat_Distance = 2.5
op.bf_Hex_Head_Height = 2.0
op.bf_Hex_Head_Flat_Distance = 5.5
op.bf_CounterSink_Head_Dia = 6.300000190734863
op.bf_Cap_Head_Height = 3.0
op.bf_Cap_Head_Dia = 5.5
op.bf_Dome_Head_Dia = 5.599999904632568
op.bf_Pan_Head_Dia = 5.599999904632568
op.bf_Thread_Length = 6.0
op.bf_Major_Dia = 3.0
op.bf_Pitch = 0.3499999940395355
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
op.bf_Hex_Nut_Height = 2.4000000953674316
op.bf_Hex_Nut_Flat_Distance = 5.5
op.bf_presets = 'M3.py'
26 changes: 26 additions & 0 deletions presets/operator/mesh.bolt_add/m10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import bpy
op = bpy.context.active_operator

op.bf_Model_Type = 'bf_Model_Bolt'
op.bf_Head_Type = 'bf_Head_Hex'
op.bf_Bit_Type = 'bf_Bit_None'
op.bf_Nut_Type = 'bf_Nut_Hex'
op.bf_Shank_Length = 0.0
op.bf_Shank_Dia = 10.0
op.bf_Allen_Bit_Depth = 5.0
op.bf_Allen_Bit_Flat_Distance = 8.0
op.bf_Hex_Head_Height = 6.400000095367432
op.bf_Hex_Head_Flat_Distance = 17.0
op.bf_CounterSink_Head_Dia = 20.0
op.bf_Cap_Head_Height = 10.0
op.bf_Cap_Head_Dia = 16.0
op.bf_Dome_Head_Dia = 20.0
op.bf_Pan_Head_Dia = 20.0
op.bf_Thread_Length = 20.0
op.bf_Major_Dia = 10.0
op.bf_Pitch = 1.25
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
op.bf_Hex_Nut_Height = 8.0
op.bf_Hex_Nut_Flat_Distance = 17.0
op.bf_presets = 'M10.py'
26 changes: 26 additions & 0 deletions presets/operator/mesh.bolt_add/m12.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import bpy
op = bpy.context.active_operator

op.bf_Model_Type = 'bf_Model_Bolt'
op.bf_Head_Type = 'bf_Head_Hex'
op.bf_Bit_Type = 'bf_Bit_None'
op.bf_Nut_Type = 'bf_Nut_Hex'
op.bf_Shank_Length = 33.0
op.bf_Shank_Dia = 12.0
op.bf_Allen_Bit_Depth = 6.0
op.bf_Allen_Bit_Flat_Distance = 10.0
op.bf_Hex_Head_Height = 7.5
op.bf_Hex_Head_Flat_Distance = 19.0
op.bf_CounterSink_Head_Dia = 22.0
op.bf_Cap_Head_Height = 12.0
op.bf_Cap_Head_Dia = 18.5
op.bf_Dome_Head_Dia = 24.0
op.bf_Pan_Head_Dia = 24.0
op.bf_Thread_Length = 32.0
op.bf_Major_Dia = 12.0
op.bf_Pitch = 1.5
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
op.bf_Hex_Nut_Height = 10.0
op.bf_Hex_Nut_Flat_Distance = 19.0
op.bf_presets = 'M12.py'
26 changes: 26 additions & 0 deletions presets/operator/mesh.bolt_add/m3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import bpy
op = bpy.context.active_operator

op.bf_Model_Type = 'bf_Model_Bolt'
op.bf_Head_Type = 'bf_Head_Hex'
op.bf_Bit_Type = 'bf_Bit_None'
op.bf_Nut_Type = 'bf_Nut_Hex'
op.bf_Shank_Length = 0.0
op.bf_Shank_Dia = 3.0
op.bf_Allen_Bit_Depth = 1.5
op.bf_Allen_Bit_Flat_Distance = 2.5
op.bf_Hex_Head_Height = 2.0
op.bf_Hex_Head_Flat_Distance = 5.5
op.bf_CounterSink_Head_Dia = 6.300000190734863
op.bf_Cap_Head_Height = 3.0
op.bf_Cap_Head_Dia = 5.5
op.bf_Dome_Head_Dia = 5.599999904632568
op.bf_Pan_Head_Dia = 5.599999904632568
op.bf_Thread_Length = 6.0
op.bf_Major_Dia = 3.0
op.bf_Pitch = 0.3499999940395355
op.bf_Crest_Percent = 10
op.bf_Root_Percent = 10
op.bf_Hex_Nut_Height = 2.4000000953674316
op.bf_Hex_Nut_Flat_Distance = 5.5
op.bf_presets = 'M3.py'
Loading

0 comments on commit 14cafb6

Please sign in to comment.