Skip to content

Commit

Permalink
Use some accel/jerk settings as Method Bead Mode values
Browse files Browse the repository at this point in the history
Populate Method series .makerbot files' meta.json with accel override settings,
for the print globally and for 'bead modes' pertaining to specific features,
per extruder. Currently, extruder-specific bead mode settings will only be
added to the meta.json if the value is non-zero.

Also disallow setting per mesh/extruder/meshgroup for accel/jerk _enabled,
_print, _travel, _travel_enabled for method-based printers
  • Loading branch information
shirleydu committed Jan 10, 2025
1 parent 382b98e commit 99d10e5
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions plugins/MakerbotWriter/MakerbotWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,75 @@ def _getMeta(self, root_nodes: List[SceneNode]) -> Tuple[Dict[str, any], str]:
"printMode": CuraApplication.getInstance().getIntentManager().currentIntentCategory,
}

if file_format == "application/x-makerbot":
accel_overrides = meta["accel_overrides"] = {}
bead_mode_overrides = accel_overrides["bead_mode"] = {}

if global_stack.getProperty('acceleration_enabled', 'value'):
global_accel_setting = global_stack.getProperty('acceleration_print', 'value')
accel_overrides["rate_mm_per_s_sq"] = {
"x": global_accel_setting,
"y": global_accel_setting
}
if global_stack.getProperty('acceleration_travel_enabled', 'value'):
travel_accel_setting = global_stack.getProperty('acceleration_travel', 'value')
bead_mode_overrides['Travel Move'] = {
"rate_mm_per_s_sq": {
"x": travel_accel_setting,
"y": travel_accel_setting
}
}

if global_stack.getProperty('jerk_enabled', 'value'):
global_jerk_setting = global_stack.getProperty('jerk_print', 'value')
accel_overrides["max_speed_change_mm_per_s"] = {
"x": global_jerk_setting,
"y": global_jerk_setting
}
if global_stack.getProperty('jerk_travel_enabled', 'value'):
travel_jerk_setting = global_stack.getProperty('jerk_travel', 'value')
if 'Travel Move' not in bead_mode_overrides:
bead_mode_overrides['Travel Move' ] = {}
bead_mode_overrides['Travel Move'].update({
"max_speed_change_mm_per_s": {
"x": travel_jerk_setting,
"y": travel_jerk_setting
}
})


# Get bead mode settings per extruder
available_bead_modes = {
"infill": "FILL",
"prime_tower": "PRIME_TOWER",
"roofing": "TOP_SURFACE",
"support_infill": "SUPPORT",
"support_interface": "SUPPORT_INTERFACE",
"wall_0": "WALL_OUTER",
"wall_x": "WALL_INNER",
"skirt_brim": "SKIRT"
}
for idx, extruder in enumerate(extruders):
for bead_mode_setting, bead_mode_tag in available_bead_modes.items():
if bead_mode_tag == "":
continue
ext_specific_tag = "%s_%s" % (bead_mode_tag, idx)
accel_val = extruder.getProperty('acceleration_%s' % bead_mode_setting, 'value')
jerk_val = extruder.getProperty('jerk_%s' % bead_mode_setting, 'value')
if accel_val != 0 or jerk_val != 0:
bead_mode_overrides[ext_specific_tag] = {}

if accel_val != 0:
bead_mode_overrides[ext_specific_tag]["rate_mm_per_s_sq"] = {
"x": accel_val,
"y": accel_val
}
if jerk_val != 0:
bead_mode_overrides[ext_specific_tag][ "max_speed_change_mm_per_s"] = {
"x": jerk_val,
"y": jerk_val
}

meta["miracle_config"] = {"gaggles": {"instance0": {}}}

version_info = dict()
Expand Down

0 comments on commit 99d10e5

Please sign in to comment.