Skip to content

Commit

Permalink
Merge pull request #152 from SpectralVectors/op-preset-patch
Browse files Browse the repository at this point in the history
Operation Preset Update
  • Loading branch information
pppalain authored Apr 6, 2024
2 parents 725e335 + 94d7171 commit def2c57
Show file tree
Hide file tree
Showing 31 changed files with 189 additions and 128 deletions.
7 changes: 5 additions & 2 deletions scripts/addons/cam/preset_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ class AddPresetCamOperation(AddPresetBase, Operator):
preset_menu = "CAM_OPERATION_MT_presets"

preset_defines = [
'import cam',
'o = cam.utils.setup_operation_preset()',
'from pathlib import Path',
'bpy.ops.scene.cam_operation_add()',
'scene = bpy.context.scene',
'o = scene.cam_operations[scene.cam_active_operation]',
"o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'",
]

preset_values = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Block'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Block'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'AROUND'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Block'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Block'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Circles'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Circles'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'AROUND'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Circles'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Circles'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Cross'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Cross'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'AROUND'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Cross'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Cross'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
10 changes: 6 additions & 4 deletions scripts/addons/cam/presets/cam_operations/Fin_Ball_3,0_Cutout.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Cutout'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Cutout'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Outline'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Outline'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Parallel'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Parallel'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'AROUND'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Parallel'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Parallel'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Pencil'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Pencil'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import bpy
import cam
from pathlib import Path

o = cam.utils.setup_operation_preset()
bpy.ops.scene.cam_operation_add()

scene = bpy.context.scene
o = scene.cam_operations[scene.cam_active_operation]

o.ambient_behaviour = 'ALL'
o.ambient_radius = 0.009999999776482582
Expand All @@ -20,7 +23,7 @@
o.dont_merge = False
o.duration = 96.3156509399414
o.feedrate = 3.0
o.filename = 'Fin_Ball_3,0_Pocket'
o.filename = o.name = f'OP_{o.object_name}_{scene.cam_active_operation + 1}_{Path(__file__).stem}'
o.free_movement_height = 0.01
o.geometry_source = 'OBJECT'
o.inverse = False
Expand All @@ -34,7 +37,6 @@
o.minz = -0.1281193494796753
o.minz_from_ob = True
o.movement_type = 'MEANDER'
o.name = 'Fin_Ball_3,0_Pocket'
o.object = None
o.optimize = True
o.optimize_threshold = 4.999999873689376e-05
Expand Down
Loading

0 comments on commit def2c57

Please sign in to comment.