Page 1 of 2

[FIXED] Postprocessing script not being executed on S3D v5.0.1

Posted: Thu Jan 26, 2023 5:30 am
by bolsoncerrado
[BUG] Postprocessing script not being executed on S3D v5.0.1

I recently opened this thread and it got deleted.

Why!?

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Thu Jan 26, 2023 7:43 am
by GunSmoker
I would assume you need to provide more details and steps to reproduce.

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Thu Jan 26, 2023 7:53 am
by bolsoncerrado
No, I did provide them all.

Also that wouldnt be the smartest move if data is insufficient.... meh

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Thu Jan 26, 2023 7:31 pm
by DrD
bolsoncerrado wrote: Thu Jan 26, 2023 7:53 am No, I did provide them all.

Also that wouldnt be the smartest move if data is insufficient.... meh
There are no visible attachments in your initial post. Any chance that you could re-upload/reattach???

D.

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Fri Jan 27, 2023 2:20 am
by bolsoncerrado
No, actually this post was more of a complaint as I already spent the time typing the original one :(

The script that is not being executed is this one:
https://github.com/idcrook/s3d-thumbnai ... ator-macos

This worked fine on v4.xx
And the script works fine on command line.

It's just v5 skipping the postprocessing execution :?

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Sun Jan 29, 2023 4:31 pm
by idcrook
It looks like the Process settings migrated correctly from v4 process for the [Scripts][Post Processing] section. Just to be sure in the Post-processing panel I manually copied the text again in case it was some weird migration issue..

Code: Select all

/Users/dpc/projects/3dprint/s3d-thumbnails/generate_S3D_thumbnails.bash "[output_filepath]"
It's a simple bash script getting called on macOS

Like the poster here said, this works as-is on v4 and and also invoking on the command line, but the v5 post-processing seems to have no effect on the output .gcode when the file is saved.

The script:
https://github.com/idcrook/s3d-thumbnai ... nails.bash

It uses some restricted API's that need permissions in the Security and Privacy settings on macOS, that need permissions from the user. But these appear to be the same ones from v4 --where, once again, it works.

This is on v5 (both 5.0 and 5.0.1) on macOS Ventura.

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Sun Jan 29, 2023 5:05 pm
by idcrook
By the way, the way it "modifies" the .gcode is that it prepends (concatenates) a comment section with .gcode path passed as an argument to a temporary file, and then moves that file back on top of original .gcode file it was provided.

Code: Select all

cat "${WORKDIR}base64.txt" "$GCODE" > "${WORKDIR}newFile.gcode"
mv "${WORKDIR}newFile.gcode" "$GCODE"
It uses $TMPDIR provided by environment for $WORKDIR

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Sun Jan 29, 2023 5:22 pm
by idcrook
and one additional note, there is some internal debugging that produces files that help to tell if script was run and what the filename argument is.

Code: Select all

$ grep '^' runtimestamp args workdir gcode
args:/Users/dpc/projects/3dprint/s3d-thumbnails/PLA_Front_Bay_Adapter-Part_1_of_2-Chassis.gcode
workdir:/var/folders/6m/nc3qqhjj4lsgs364xtn7fgsr0000gn/T/
gcode:/Users/dpc/projects/3dprint/s3d-thumbnails/PLA_Front_Bay_Adapter-Part_1_of_2-Chassis.gcode
This shows that the post-processing script itself is being executed from Simplify3D v5 when the .gocde is saved (as expected).

Is there a way to to see the STDOUT of a post-processing script?

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Sun Jan 29, 2023 5:37 pm
by idcrook
now we're getting somewhere.

I added an additional debug trace output file that gets created near end of script execution when it is ready to insert the thumbnail encodings.

in v5 this debug file is not getting created which implies script is not reaching that point on v5.
in v4 this debug file IS getting created (as it is working on v4)

Commit with this addition (already pushed to main):
https://github.com/idcrook/s3d-thumbnai ... 3b7d84a3f0

Re: [BUG] Postprocessing script not being executed on S3D v5.0.1

Posted: Mon Jan 30, 2023 9:33 am
by S3D-Jason
It may help to review this recent thread:
viewtopic.php?p=63885#p63885

It gives an example showing how to prove the scripts run correctly. We have already tested that process on several operating systems and it worked on each one, so it should be a good place to start. Of course, if you are using a custom script you have to make sure it doesn't error out earlier on in the script, but it should at least explain the basics and give you a sample script to show V5 is working correctly.