Skip to content

Commit 99d10e5

Browse files
committedJan 10, 2025
Use some accel/jerk settings as Method Bead Mode values
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
1 parent 382b98e commit 99d10e5

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
 

‎plugins/MakerbotWriter/MakerbotWriter.py

+69
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,75 @@ def _getMeta(self, root_nodes: List[SceneNode]) -> Tuple[Dict[str, any], str]:
254254
"printMode": CuraApplication.getInstance().getIntentManager().currentIntentCategory,
255255
}
256256

257+
if file_format == "application/x-makerbot":
258+
accel_overrides = meta["accel_overrides"] = {}
259+
bead_mode_overrides = accel_overrides["bead_mode"] = {}
260+
261+
if global_stack.getProperty('acceleration_enabled', 'value'):
262+
global_accel_setting = global_stack.getProperty('acceleration_print', 'value')
263+
accel_overrides["rate_mm_per_s_sq"] = {
264+
"x": global_accel_setting,
265+
"y": global_accel_setting
266+
}
267+
if global_stack.getProperty('acceleration_travel_enabled', 'value'):
268+
travel_accel_setting = global_stack.getProperty('acceleration_travel', 'value')
269+
bead_mode_overrides['Travel Move'] = {
270+
"rate_mm_per_s_sq": {
271+
"x": travel_accel_setting,
272+
"y": travel_accel_setting
273+
}
274+
}
275+
276+
if global_stack.getProperty('jerk_enabled', 'value'):
277+
global_jerk_setting = global_stack.getProperty('jerk_print', 'value')
278+
accel_overrides["max_speed_change_mm_per_s"] = {
279+
"x": global_jerk_setting,
280+
"y": global_jerk_setting
281+
}
282+
if global_stack.getProperty('jerk_travel_enabled', 'value'):
283+
travel_jerk_setting = global_stack.getProperty('jerk_travel', 'value')
284+
if 'Travel Move' not in bead_mode_overrides:
285+
bead_mode_overrides['Travel Move' ] = {}
286+
bead_mode_overrides['Travel Move'].update({
287+
"max_speed_change_mm_per_s": {
288+
"x": travel_jerk_setting,
289+
"y": travel_jerk_setting
290+
}
291+
})
292+
293+
294+
# Get bead mode settings per extruder
295+
available_bead_modes = {
296+
"infill": "FILL",
297+
"prime_tower": "PRIME_TOWER",
298+
"roofing": "TOP_SURFACE",
299+
"support_infill": "SUPPORT",
300+
"support_interface": "SUPPORT_INTERFACE",
301+
"wall_0": "WALL_OUTER",
302+
"wall_x": "WALL_INNER",
303+
"skirt_brim": "SKIRT"
304+
}
305+
for idx, extruder in enumerate(extruders):
306+
for bead_mode_setting, bead_mode_tag in available_bead_modes.items():
307+
if bead_mode_tag == "":
308+
continue
309+
ext_specific_tag = "%s_%s" % (bead_mode_tag, idx)
310+
accel_val = extruder.getProperty('acceleration_%s' % bead_mode_setting, 'value')
311+
jerk_val = extruder.getProperty('jerk_%s' % bead_mode_setting, 'value')
312+
if accel_val != 0 or jerk_val != 0:
313+
bead_mode_overrides[ext_specific_tag] = {}
314+
315+
if accel_val != 0:
316+
bead_mode_overrides[ext_specific_tag]["rate_mm_per_s_sq"] = {
317+
"x": accel_val,
318+
"y": accel_val
319+
}
320+
if jerk_val != 0:
321+
bead_mode_overrides[ext_specific_tag][ "max_speed_change_mm_per_s"] = {
322+
"x": jerk_val,
323+
"y": jerk_val
324+
}
325+
257326
meta["miracle_config"] = {"gaggles": {"instance0": {}}}
258327

259328
version_info = dict()

0 commit comments

Comments
 (0)