bolsoncerrado
Posts: 177
Joined: Tue Mar 17, 2015 10:55 am

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

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

I recently opened this thread and it got deleted.

Why!?
GunSmoker
Posts: 4
Joined: Mon May 04, 2020 9:25 am

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

I would assume you need to provide more details and steps to reproduce.
bolsoncerrado
Posts: 177
Joined: Tue Mar 17, 2015 10:55 am

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

No, I did provide them all.

Also that wouldnt be the smartest move if data is insufficient.... meh
DrD
Posts: 74
Joined: Sun Dec 25, 2022 8:24 pm
Location: Canada

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

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.
You don't know what you don't know until you know (my philosophy for continued learning).
bolsoncerrado
Posts: 177
Joined: Tue Mar 17, 2015 10:55 am

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

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 :?
idcrook
Posts: 9
Joined: Wed Dec 12, 2018 5:58 pm

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

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.
idcrook
Posts: 9
Joined: Wed Dec 12, 2018 5:58 pm

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

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
idcrook
Posts: 9
Joined: Wed Dec 12, 2018 5:58 pm

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

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?
idcrook
Posts: 9
Joined: Wed Dec 12, 2018 5:58 pm

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

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
S3D-Jason
Posts: 1379
Joined: Sun May 31, 2015 6:01 am

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

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.

Return to “Troubleshooting and Bug Reports”