-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
embed QOI thumbnail images when using "Save to Disk" option
similar the PostProcessing plugin by hooking into writeStarted event
- Loading branch information
Showing
5 changed files
with
57 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from io import StringIO | ||
from typing import cast | ||
|
||
from UM.Logger import Logger | ||
from UM.Mesh.MeshWriter import MeshWriter | ||
from UM.PluginRegistry import PluginRegistry | ||
|
||
|
||
def serializing_scene_to_gcode(): | ||
# get the gcode through the GCodeWrite plugin | ||
# this serializes the actual scene and should produce the same output as "Save to File" | ||
|
||
Logger.log("d", "Serializing gcode...") | ||
gcode_writer = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter")) | ||
gcode_stream = StringIO() | ||
success = gcode_writer.write(gcode_stream, None) | ||
if not success: | ||
Logger.log("e", "GCodeWriter failed.") | ||
return None | ||
return gcode_stream |