kopia lustrzana https://github.com/vilemduha/blendercam
fix updateRest function
rodzic
3ed263e576
commit
ab66753761
|
@ -89,12 +89,7 @@ def updateScale():
|
|||
ob.scale.s=ob.scale.z
|
||||
ob.scale.y=ob.scale.z
|
||||
'''
|
||||
|
||||
def updateChipload(self,context):
|
||||
'''this is very simple computation of chip size, could be very much improved'''
|
||||
o=self;
|
||||
self.chipload = int((o.feedrate/(o.spindle_rpm*o.cutter_flutes))*1000000)/1000
|
||||
|
||||
|
||||
def getChangeData(o):####this is a function to check if object props have changed, to see if image updates are needed
|
||||
s=bpy.context.scene
|
||||
changedata=''
|
||||
|
@ -112,6 +107,7 @@ def getChangeData(o):####this is a function to check if object props have change
|
|||
|
||||
def operationValid(self,context):
|
||||
o=self
|
||||
o.changed=True
|
||||
o.valid=True
|
||||
o.warnings=""
|
||||
o=bpy.context.scene.cam_operations[bpy.context.scene.cam_active_operation]
|
||||
|
@ -138,30 +134,44 @@ def operationValid(self,context):
|
|||
print('validity ')
|
||||
#print(o.valid)
|
||||
|
||||
#Update functions start here
|
||||
def updateChipload(self,context):
|
||||
'''this is very simple computation of chip size, could be very much improved'''
|
||||
o=self;
|
||||
self.changed=True
|
||||
self.chipload = int((o.feedrate/(o.spindle_rpm*o.cutter_flutes))*1000000)/1000
|
||||
|
||||
|
||||
def updateOffsetImage(self,context):
|
||||
'''refresh offset image tag for rerendering'''
|
||||
#print('update offset')
|
||||
self.changed=True
|
||||
|
||||
self.update_offsetimage_tag=True
|
||||
|
||||
def updateZbufferImage(self,context):
|
||||
#print('updatezbuf')
|
||||
#print(self,context)
|
||||
self.changed=True
|
||||
self.update_zbufferimage_tag=True
|
||||
self.update_offsetimage_tag=True
|
||||
|
||||
def updateStrategy(o,context):
|
||||
o.changed=True
|
||||
updateExact(o,context)
|
||||
|
||||
def updateExact(o,context):
|
||||
o.changed=True
|
||||
if o.use_exact and (o.strategy=='WATERLINE' or o.strategy=='POCKET' or o.inverse):
|
||||
o.use_exact=False
|
||||
|
||||
def updateRest(o,context):
|
||||
o.changed=True
|
||||
|
||||
class camOperation(bpy.types.PropertyGroup):
|
||||
|
||||
name = bpy.props.StringProperty(name="Operation Name", default="Operation")
|
||||
filename = bpy.props.StringProperty(name="File name", default="Operation")
|
||||
name = bpy.props.StringProperty(name="Operation Name", default="Operation", update = updateRest)
|
||||
filename = bpy.props.StringProperty(name="File name", default="Operation", update = updateRest)
|
||||
|
||||
#group = bpy.props.StringProperty(name='Object group', description='group of objects which will be included in this operation')
|
||||
object_name = bpy.props.StringProperty(name='Object', description='object handled by this operation', update=operationValid)
|
||||
|
@ -198,42 +208,42 @@ class camOperation(bpy.types.PropertyGroup):
|
|||
default='PARALLEL',
|
||||
update = updateStrategy)#,('SLICES','Slices','this prepares model for cutting from sheets of material')
|
||||
#for cutout
|
||||
cut_type = EnumProperty(name='Cut:',items=(('OUTSIDE', 'Outside', 'a'),('INSIDE', 'Inside', 'a'),('ONLINE', 'On line', 'a')),description='Type of cutter used',default='OUTSIDE')
|
||||
cut_type = EnumProperty(name='Cut:',items=(('OUTSIDE', 'Outside', 'a'),('INSIDE', 'Inside', 'a'),('ONLINE', 'On line', 'a')),description='Type of cutter used',default='OUTSIDE', update = updateRest)
|
||||
#render_all = bpy.props.BoolProperty(name="Use all geometry",description="use also other objects in the scene", default=True)#replaced with groups support
|
||||
inverse = bpy.props.BoolProperty(name="Inverse milling",description="Male to female model conversion", default=False, update = updateOffsetImage)
|
||||
|
||||
cutter_id = IntProperty(name="Tool number", description="For machines which support tool change based on tool id", min=0, max=10000, default=0)
|
||||
cutter_id = IntProperty(name="Tool number", description="For machines which support tool change based on tool id", min=0, max=10000, default=0, update = updateRest)
|
||||
cutter_diameter = FloatProperty(name="Cutter diameter", description="Cutter diameter = 2x cutter radius", min=0.000001, max=0.1, default=0.003, precision=PRECISION, unit="LENGTH", update = updateOffsetImage)
|
||||
cutter_length = FloatProperty(name="#Cutter length", description="#not supported#Cutter length", min=0.0, max=100.0, default=25.0,precision=PRECISION, unit="LENGTH", update = updateOffsetImage)
|
||||
cutter_flutes = IntProperty(name="Cutter flutes", description="Cutter flutes", min=1, max=20, default=2, update = updateChipload)
|
||||
cutter_tip_angle = FloatProperty(name="Cutter v-carve angle", description="Cutter v-carve angle", min=0.0, max=180.0, default=60.0,precision=PRECISION, update = updateOffsetImage)
|
||||
|
||||
dist_between_paths = bpy.props.FloatProperty(name="Distance between toolpaths", default=0.001, min=0.00001, max=32,precision=PRECISION, unit="LENGTH")
|
||||
dist_along_paths = bpy.props.FloatProperty(name="Distance along toolpaths", default=0.0002, min=0.00001, max=32,precision=PRECISION, unit="LENGTH")
|
||||
parallel_angle = bpy.props.FloatProperty(name="Angle of paths", default=0, min=-360, max=360 , precision=0, subtype="ANGLE" , unit="ROTATION" )
|
||||
carve_depth = bpy.props.FloatProperty(name="Carve depth", default=0.001, min=-.100, max=32,precision=PRECISION, unit="LENGTH")
|
||||
drill_type = EnumProperty(name='Holes on',items=(('MIDDLE_SYMETRIC', 'Middle of symetric curves', 'a'),('MIDDLE_ALL', 'Middle of all curve parts', 'a'),('ALL_POINTS', 'All points in curve', 'a')),description='Strategy to detect holes to drill',default='MIDDLE_SYMETRIC')
|
||||
dist_between_paths = bpy.props.FloatProperty(name="Distance between toolpaths", default=0.001, min=0.00001, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
dist_along_paths = bpy.props.FloatProperty(name="Distance along toolpaths", default=0.0002, min=0.00001, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
parallel_angle = bpy.props.FloatProperty(name="Angle of paths", default=0, min=-360, max=360 , precision=0, subtype="ANGLE" , unit="ROTATION" , update = updateRest)
|
||||
carve_depth = bpy.props.FloatProperty(name="Carve depth", default=0.001, min=-.100, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
drill_type = EnumProperty(name='Holes on',items=(('MIDDLE_SYMETRIC', 'Middle of symetric curves', 'a'),('MIDDLE_ALL', 'Middle of all curve parts', 'a'),('ALL_POINTS', 'All points in curve', 'a')),description='Strategy to detect holes to drill',default='MIDDLE_SYMETRIC', update = updateRest)
|
||||
|
||||
slice_detail = bpy.props.FloatProperty(name="Distance betwen slices", default=0.001, min=0.00001, max=32,precision=PRECISION, unit="LENGTH")
|
||||
waterline_fill = bpy.props.BoolProperty(name="Fill areas between slices",description="Fill areas between slices in waterline mode", default=True)
|
||||
waterline_project = bpy.props.BoolProperty(name="Project paths",description="Project paths in areas between slices", default=True)
|
||||
slice_detail = bpy.props.FloatProperty(name="Distance betwen slices", default=0.001, min=0.00001, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
waterline_fill = bpy.props.BoolProperty(name="Fill areas between slices",description="Fill areas between slices in waterline mode", default=True, update = updateRest)
|
||||
waterline_project = bpy.props.BoolProperty(name="Project paths",description="Project paths in areas between slices", default=True, update = updateRest)
|
||||
|
||||
circle_detail = bpy.props.IntProperty(name="Detail of circles used for curve offsets", default=64, min=12, max=512)
|
||||
use_layers = bpy.props.BoolProperty(name="Use Layers",description="Use layers for roughing", default=True)
|
||||
stepdown = bpy.props.FloatProperty(name="Step down", default=0.01, min=0.00001, max=32,precision=PRECISION, unit="LENGTH")
|
||||
first_down = bpy.props.BoolProperty(name="First down",description="First go down on a contour, then go to the next one", default=False)
|
||||
contour_ramp = bpy.props.BoolProperty(name="Ramp contour - EXPERIMENTAL",description="Ramps down the whole contour, so the cutline looks like helix", default=False)
|
||||
ramp_out = bpy.props.BoolProperty(name="Ramp out - EXPERIMENTAL",description="Ramp out to not leave mark on surface", default=False)
|
||||
ramp_out_angle = bpy.props.FloatProperty(name="Ramp out angle", default=math.pi/6, min=0, max=math.pi*0.4999 , precision=1, subtype="ANGLE" , unit="ROTATION" )
|
||||
helix_enter = bpy.props.BoolProperty(name="Helix enter - EXPERIMENTAL",description="Enter material in helix", default=False)
|
||||
helix_angle = bpy.props.FloatProperty(name="Helix ramp angle", default=3*math.pi/180, min=0.00001, max=math.pi*0.4999,precision=1, subtype="ANGLE" , unit="ROTATION" )
|
||||
helix_diameter = bpy.props.FloatProperty(name = 'Helix diameter % of cutter D', default=90,min=10, max=100, precision=1,subtype='PERCENTAGE')
|
||||
retract_tangential = bpy.props.BoolProperty(name="Retract tangential - EXPERIMENTAL",description="Retract from material in circular motion", default=False)
|
||||
retract_radius = bpy.props.FloatProperty(name = 'Retract arc radius', default=0.001,min=0.000001, max=100, precision=PRECISION, unit="LENGTH")
|
||||
retract_height = bpy.props.FloatProperty(name = 'Retract arc height', default=0.001,min=0.00000, max=100, precision=PRECISION, unit="LENGTH")
|
||||
circle_detail = bpy.props.IntProperty(name="Detail of circles used for curve offsets", default=64, min=12, max=512, update = updateRest)
|
||||
use_layers = bpy.props.BoolProperty(name="Use Layers",description="Use layers for roughing", default=True, update = updateRest)
|
||||
stepdown = bpy.props.FloatProperty(name="Step down", default=0.01, min=0.00001, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
first_down = bpy.props.BoolProperty(name="First down",description="First go down on a contour, then go to the next one", default=False, update = updateRest)
|
||||
contour_ramp = bpy.props.BoolProperty(name="Ramp contour - EXPERIMENTAL",description="Ramps down the whole contour, so the cutline looks like helix", default=False, update = updateRest)
|
||||
ramp_out = bpy.props.BoolProperty(name="Ramp out - EXPERIMENTAL",description="Ramp out to not leave mark on surface", default=False, update = updateRest)
|
||||
ramp_out_angle = bpy.props.FloatProperty(name="Ramp out angle", default=math.pi/6, min=0, max=math.pi*0.4999 , precision=1, subtype="ANGLE" , unit="ROTATION" , update = updateRest)
|
||||
helix_enter = bpy.props.BoolProperty(name="Helix enter - EXPERIMENTAL",description="Enter material in helix", default=False, update = updateRest)
|
||||
helix_angle = bpy.props.FloatProperty(name="Helix ramp angle", default=3*math.pi/180, min=0.00001, max=math.pi*0.4999,precision=1, subtype="ANGLE" , unit="ROTATION" , update = updateRest)
|
||||
helix_diameter = bpy.props.FloatProperty(name = 'Helix diameter % of cutter D', default=90,min=10, max=100, precision=1,subtype='PERCENTAGE', update = updateRest)
|
||||
retract_tangential = bpy.props.BoolProperty(name="Retract tangential - EXPERIMENTAL",description="Retract from material in circular motion", default=False, update = updateRest)
|
||||
retract_radius = bpy.props.FloatProperty(name = 'Retract arc radius', default=0.001,min=0.000001, max=100, precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
retract_height = bpy.props.FloatProperty(name = 'Retract arc height', default=0.001,min=0.00000, max=100, precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
|
||||
minz_from_ob = bpy.props.BoolProperty(name="Depth from object",description="Operation depth from object", default=True)
|
||||
minz = bpy.props.FloatProperty(name="Operation depth", default=-0.01, min=-3, max=0,precision=PRECISION, unit="LENGTH")#this is input minz. True minimum z can be something else, depending on material e.t.c.
|
||||
minz_from_ob = bpy.props.BoolProperty(name="Depth from object",description="Operation depth from object", default=True, update = updateRest)
|
||||
minz = bpy.props.FloatProperty(name="Operation depth", default=-0.01, min=-3, max=0,precision=PRECISION, unit="LENGTH", update = updateRest)#this is input minz. True minimum z can be something else, depending on material e.t.c.
|
||||
|
||||
source_image_scale_z=bpy.props.FloatProperty(name="Image source depth scale", default=0.01, min=-1, max=1,precision=PRECISION, unit="LENGTH", update = updateZbufferImage)
|
||||
source_image_size_x=bpy.props.FloatProperty(name="Image source x size", default=0.1, min=-10, max=10,precision=PRECISION, unit="LENGTH", update = updateZbufferImage)
|
||||
|
@ -247,38 +257,38 @@ class camOperation(bpy.types.PropertyGroup):
|
|||
protect_vertical = bpy.props.BoolProperty(name="Protect vertical",description="The path goes only vertically next to steep areas", default=True)
|
||||
|
||||
|
||||
ambient_behaviour = EnumProperty(name='Ambient',items=(('ALL', 'All', 'a'),('AROUND', 'Around', 'a') ),description='handling ambient surfaces',default='ALL')
|
||||
ambient_behaviour = EnumProperty(name='Ambient',items=(('ALL', 'All', 'a'),('AROUND', 'Around', 'a') ),description='handling ambient surfaces',default='ALL', update = updateRest)
|
||||
|
||||
|
||||
ambient_radius = FloatProperty(name="Ambient radius", description="Radius around the part which will be milled if ambient is set to Around", min=0.0, max=100.0, default=0.01, precision=PRECISION, unit="LENGTH")
|
||||
ambient_radius = FloatProperty(name="Ambient radius", description="Radius around the part which will be milled if ambient is set to Around", min=0.0, max=100.0, default=0.01, precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
#ambient_cutter = EnumProperty(name='Borders',items=(('EXTRAFORCUTTER', 'Extra for cutter', "Extra space for cutter is cut around the segment"),('ONBORDER', "Cutter on edge", "Cutter goes exactly on edge of ambient with it's middle") ,('INSIDE', "Inside segment", 'Cutter stays within segment') ),description='handling of ambient and cutter size',default='INSIDE')
|
||||
use_limit_curve=bpy.props.BoolProperty(name="Use limit curve",description="A curve limits the operation area", default=False)
|
||||
limit_curve= bpy.props.StringProperty(name='Limit curve', description='curve used to limit the area of the operation')
|
||||
use_limit_curve=bpy.props.BoolProperty(name="Use limit curve",description="A curve limits the operation area", default=False, update = updateRest)
|
||||
limit_curve= bpy.props.StringProperty(name='Limit curve', description='curve used to limit the area of the operation', update = updateRest)
|
||||
|
||||
skin = FloatProperty(name="Skin", description="Material to leave when roughing ", min=0.0, max=1.0, default=0.0,precision=PRECISION, unit="LENGTH", update = updateOffsetImage)
|
||||
#feeds
|
||||
feedrate = FloatProperty(name="Feedrate/minute", description="Feedrate m/min", min=0.00005, max=50.0, default=1.0,precision=PRECISION, unit="LENGTH", update = updateChipload)
|
||||
plunge_feedrate = FloatProperty(name="Plunge speed ", description="% of feedrate", min=0.1, max=100.0, default=50.0,precision=1, subtype='PERCENTAGE')
|
||||
plunge_angle = bpy.props.FloatProperty(name="Plunge angle", description="What angle is allready considered to plunge", default=math.pi/6, min=0, max=math.pi*0.5 , precision=0, subtype="ANGLE" , unit="ROTATION" )
|
||||
plunge_feedrate = FloatProperty(name="Plunge speed ", description="% of feedrate", min=0.1, max=100.0, default=50.0,precision=1, subtype='PERCENTAGE', update = updateRest)
|
||||
plunge_angle = bpy.props.FloatProperty(name="Plunge angle", description="What angle is allready considered to plunge", default=math.pi/6, min=0, max=math.pi*0.5 , precision=0, subtype="ANGLE" , unit="ROTATION" , update = updateRest)
|
||||
spindle_rpm = FloatProperty(name="#Spindle rpm", description="#not supported#Spindle speed ", min=1000, max=60000, default=12000, update = updateChipload)
|
||||
#movement parallel_step_back
|
||||
movement_type = EnumProperty(name='Movement type',items=(('CONVENTIONAL','Conventional', 'a'),('CLIMB', 'Climb', 'a'),('MEANDER', 'Meander' , 'a') ),description='movement type', default='CLIMB')
|
||||
spindle_rotation_direction = EnumProperty(name='Spindle rotation', items=(('CW','Clock wise', 'a'),('CCW', 'Counter clock wise', 'a')),description='Spindle rotation direction',default='CW')
|
||||
free_movement_height = bpy.props.FloatProperty(name="Free movement height", default=0.01, min=0.0000, max=32,precision=PRECISION, unit="LENGTH")
|
||||
movement_insideout = EnumProperty(name='Direction', items=(('INSIDEOUT','Inside out', 'a'),('OUTSIDEIN', 'Outside in', 'a')),description='approach to the piece',default='INSIDEOUT')
|
||||
parallel_step_back = bpy.props.BoolProperty(name="Parallel step back", description='For roughing and finishing in one pass: mills material in climb mode, then steps back and goes between 2 last chunks back', default=False)
|
||||
stay_low = bpy.props.BoolProperty(name="Stay low if possible", default=False)
|
||||
movement_type = EnumProperty(name='Movement type',items=(('CONVENTIONAL','Conventional', 'a'),('CLIMB', 'Climb', 'a'),('MEANDER', 'Meander' , 'a') ),description='movement type', default='CLIMB', update = updateRest)
|
||||
spindle_rotation_direction = EnumProperty(name='Spindle rotation', items=(('CW','Clock wise', 'a'),('CCW', 'Counter clock wise', 'a')),description='Spindle rotation direction',default='CW', update = updateRest)
|
||||
free_movement_height = bpy.props.FloatProperty(name="Free movement height", default=0.01, min=0.0000, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
movement_insideout = EnumProperty(name='Direction', items=(('INSIDEOUT','Inside out', 'a'),('OUTSIDEIN', 'Outside in', 'a')),description='approach to the piece',default='INSIDEOUT', update = updateRest)
|
||||
parallel_step_back = bpy.props.BoolProperty(name="Parallel step back", description='For roughing and finishing in one pass: mills material in climb mode, then steps back and goes between 2 last chunks back', default=False, update = updateRest)
|
||||
stay_low = bpy.props.BoolProperty(name="Stay low if possible", default=False, update = updateRest)
|
||||
#optimization and performance
|
||||
use_exact = bpy.props.BoolProperty(name="Use exact mode",description="Exact mode allows greater precision, but is slower with complex meshes", default=True, update = updateExact)
|
||||
pixsize=bpy.props.FloatProperty(name="sampling raster detail", default=0.0001, min=0.00001, max=0.01,precision=PRECISION, unit="LENGTH", update = updateZbufferImage)
|
||||
simulation_detail=bpy.props.FloatProperty(name="Simulation sampling raster detail", default=0.0001, min=0.00001, max=0.01,precision=PRECISION, unit="LENGTH")
|
||||
optimize = bpy.props.BoolProperty(name="Reduce path points",description="Reduce path points", default=True)
|
||||
optimize_threshold=bpy.props.FloatProperty(name="Reduction threshold", default=0.000001, min=0.00000001, max=1,precision=PRECISION, unit="LENGTH")
|
||||
dont_merge = bpy.props.BoolProperty(name="Dont merge outlines when cutting",description="this is usefull when you want to cut around everything", default=False)
|
||||
simulation_detail=bpy.props.FloatProperty(name="Simulation sampling raster detail", default=0.0001, min=0.00001, max=0.01,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
optimize = bpy.props.BoolProperty(name="Reduce path points",description="Reduce path points", default=True, update = updateRest)
|
||||
optimize_threshold=bpy.props.FloatProperty(name="Reduction threshold", default=0.000001, min=0.00000001, max=1,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
dont_merge = bpy.props.BoolProperty(name="Dont merge outlines when cutting",description="this is usefull when you want to cut around everything", default=False, update = updateRest)
|
||||
|
||||
pencil_threshold=bpy.props.FloatProperty(name="Pencil threshold", default=0.00002, min=0.00000001, max=1,precision=PRECISION, unit="LENGTH")
|
||||
pencil_threshold=bpy.props.FloatProperty(name="Pencil threshold", default=0.00002, min=0.00000001, max=1,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
#calculations
|
||||
duration = bpy.props.FloatProperty(name="Estimated time", default=0.01, min=0.0000, max=32,precision=PRECISION, unit="TIME")
|
||||
duration = bpy.props.FloatProperty(name="Estimated time", default=0.01, min=0.0000, max=32,precision=PRECISION, unit="TIME", update = updateRest)
|
||||
#chip_rate
|
||||
|
||||
#optimisation panel
|
||||
|
@ -288,10 +298,10 @@ class camOperation(bpy.types.PropertyGroup):
|
|||
material_radius_around_model = bpy.props.FloatProperty(name="radius around model",description="How much to add to model size on all sides", default=0.0, unit='LENGTH', precision=PRECISION, update = updateZbufferImage)
|
||||
material_origin=bpy.props.FloatVectorProperty(name = 'Material origin', default=(0,0,0), unit='LENGTH', precision=PRECISION,subtype="XYZ", update = updateZbufferImage)
|
||||
material_size=bpy.props.FloatVectorProperty(name = 'Material size', default=(0.200,0.200,0.100), unit='LENGTH', precision=PRECISION,subtype="XYZ", update = updateZbufferImage)
|
||||
min=bpy.props.FloatVectorProperty(name = 'Operation minimum', default=(0,0,0), unit='LENGTH', precision=PRECISION,subtype="XYZ")
|
||||
max=bpy.props.FloatVectorProperty(name = 'Operation maximum', default=(0,0,0), unit='LENGTH', precision=PRECISION,subtype="XYZ")
|
||||
warnings = bpy.props.StringProperty(name='warnings', description='warnings', default='')
|
||||
chipload = bpy.props.FloatProperty(name="chipload",description="Calculated chipload", default=0.0, unit='LENGTH', precision=PRECISION)
|
||||
min=bpy.props.FloatVectorProperty(name = 'Operation minimum', default=(0,0,0), unit='LENGTH', precision=PRECISION,subtype="XYZ", update = updateRest)
|
||||
max=bpy.props.FloatVectorProperty(name = 'Operation maximum', default=(0,0,0), unit='LENGTH', precision=PRECISION,subtype="XYZ", update = updateRest)
|
||||
warnings = bpy.props.StringProperty(name='warnings', description='warnings', default='', update = updateRest)
|
||||
chipload = bpy.props.FloatProperty(name="chipload",description="Calculated chipload", default=0.0, unit='LENGTH', precision=PRECISION, update = updateRest)
|
||||
#internal properties
|
||||
###########################################
|
||||
#testing = bpy.props.IntProperty(name="developer testing ", description="This is just for script authors for help in coding, keep 0", default=0, min=0, max=512)
|
||||
|
@ -305,7 +315,7 @@ class camOperation(bpy.types.PropertyGroup):
|
|||
object=None
|
||||
path_object_name=bpy.props.StringProperty(name='Path object', description='actual cnc path')
|
||||
|
||||
|
||||
changed=bpy.props.BoolProperty(name="True if any of the operation settings has changed",description="mark for update", default=False)
|
||||
update_zbufferimage_tag=bpy.props.BoolProperty(name="mark zbuffer image for update",description="mark for update", default=True)
|
||||
update_offsetimage_tag=bpy.props.BoolProperty(name="mark offset image for update",description="mark for update", default=True)
|
||||
update_silhouete_tag=bpy.props.BoolProperty(name="mark silhouette image for update",description="mark for update", default=True)
|
||||
|
@ -329,13 +339,11 @@ class opName(bpy.types.PropertyGroup):#this type is defined just to hold referen
|
|||
class camChain(bpy.types.PropertyGroup):#chain is just a set of operations which get connected on export into 1 file.
|
||||
index = bpy.props.IntProperty(name="index", description="index in the hard-defined camChains", default=-1)
|
||||
active_operation = bpy.props.IntProperty(name="active operation", description="active operation in chain", default=-1)
|
||||
#operations = bpy.props.StringProperty(name='operations', description='operations', default='')
|
||||
name = bpy.props.StringProperty(name="Chain Name", default="Chain")
|
||||
filename = bpy.props.StringProperty(name="File name", default="Chain")
|
||||
filename = bpy.props.StringProperty(name="File name", default="Chain")#filename of
|
||||
valid = bpy.props.BoolProperty(name="Valid",description="True if whole chain is ok for calculation", default=True);
|
||||
computing = bpy.props.BoolProperty(name="Computing right now",description="", default=False)
|
||||
operations= bpy.props.CollectionProperty(type=opName)
|
||||
#bpy.types.CollectionProperty(type=camOperation)
|
||||
operations= bpy.props.CollectionProperty(type=opName)#this is to hold just operation names.
|
||||
|
||||
|
||||
class threadCom:#object passed to threads to read background process stdout info
|
||||
|
@ -524,6 +532,28 @@ class PathsAll(bpy.types.Operator):
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.prop_search(self, "operation", bpy.context.scene, "cam_operations")
|
||||
|
||||
class PathsChain(bpy.types.Operator):
|
||||
'''calculate all CAM paths'''
|
||||
bl_idname = "object.calculate_cam_paths_chain"
|
||||
bl_label = "Calculate CAM paths in current chain and export chain gcode"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def execute(self, context):
|
||||
import bpy
|
||||
i=0
|
||||
for o in bpy.context.scene.cam_operations:
|
||||
bpy.context.scene.cam_active_operation=i
|
||||
print('\nCalculating path :'+o.name)
|
||||
print('\n')
|
||||
bpy.ops.object.calculate_cam_paths_background()
|
||||
i+=1
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.prop_search(self, "operation", bpy.context.scene, "cam_operations")
|
||||
|
||||
class CAMSimulate(bpy.types.Operator):
|
||||
'''simulate CAM operation'''
|
||||
|
|
Ładowanie…
Reference in New Issue