Jump to content
Ultimaker Community of 3D Printing Experts
Harry Plotter

Need your help in reconfiguring the dump file folder in python

Recommended Posts

Hi to all 3D-Print addicted (like me).

 

Cold weather and the dark season thrives me back into my home wanting to create new stuff. Sometimes something goes wrong (not that you know of those problems ;O) ) but for me one thing that helps me is my built in camera of the UM3. I use one of the scripts I found here in the community. It is written in python and it works great (Timelapse.py). There is just one trouble with it and I can not find a way of changing the dumping folder in the program itself.

Right now it uses the "temp"-Folder of my PC in order to sequentially save a foto there. Then when the print is over, the program takes those fotos and combines them together to an .mp4-File that can be watched.

In the past and when i was printing things this was a good way to see the print in a few seconds and say "Yes, that was good" or at some point "sc.. what happened"... this way sometimes I could figure out the problem just by looking at the condensed film.

Now as I come out more often to print jobs that take more time (1 day and more) the problem starts. The "temp"-Folder of my PC emptys itself out every time 24h have past and this effects the dumped pictures as well. In the beginning I thought I was doing something wrong but actually the program needs a continuity in order to combine the fotos to the vid. Once the PC has erased one day of fotos the next fotos are continuing with for example tx000130 and not with tx000001. Combining them will not work anymore and the program crashes every time this happens and leaves me only with the fotos of the last day...

First try to find out how to avoid the automatic erase of the "temp"-Folder was not successfull... anyhow the Software would not have to installed such a folder if it wasn´t for a good reason. Therefore in the next step I tried to find if the "temp"-Folder would be written in the python-program as a path. But this as well was not the case. And to interpret the language I am not into python-programming too much as to say that I would want to change anything in there.

 

Therefore my question:

 

Maybe one of you is good in programming with python and can reprogram the saving-folder to a different place (any place that is not erased automatically after a certain time and not the desktop would help).

 

I will leave you with the program itself so that you may use and reprogram it as you wish.

 

Thank you for any help regarding this problem.

 

Greetings

 

 

Daniel

 

PS: please try not to "unzip" the file. I just changed .py to .zip in order to beeing able to attach it here ;O)

timelapse.zip

Share this post


Link to post
Share on other sites

It is easy and I can do it for you later today.

 

There is a function in the code which returns the path and name of the directory. So the python code/function uses a system call to get the temp directory of your system including a temporary/random filename.

 

I can look into it a little bit later, have to get breakfast first (Austria) ?

Share this post


Link to post
Share on other sites

Ok, here we go:

 

Look for a line like this: (should be line number 59

Quote

tmpdir = mkdtemp()

 

and change the line to this: (change the bold part and keep the ' before and after the path)

Quote

tmpdir = mkdtemp(dir='C:\Path\to\whatever')

 

That's it and should work for windows too, but I could not test it, I have only Mac and Linux available.

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi Smithy,

 

thank you so much... I´ll change it a bit later and try it on my next bigger printout. I´ll let you know it it worked..

 

Breakfast in Austria= Great! Need to visit some place there again soon (probbably for skiing purpouses).. but I miss your local food!

 

Greetings from Heidelberg

 

Daniel

 

PS: I have added a little something I just did the day before yesterday as a present. Maybe it is worth some use... I have tried it and it works great for me. Feel free to add, adapt or change anything you like... The holes I leave it up to you to drill or draw in later as the frequency can be adapted (Not everybody wants to start with a C..)

Flöte fertig ohne Löcher.zip

Share this post


Link to post
Share on other sites

Hi Daniel

test it before with a smaller thing, just to see if the thing with the windows paths are working, I could not test it.

 

If you run into this problem, you can try to double the backslashes \\

or use the os.path function @JohnInOttowa mentioned

or use a newer method pathlib

 

But test it first, maybe with \\ and if it is not working let me know, I have a Windows in the office, where I can test it.

Share this post


Link to post
Share on other sites

Hi Smithy,

Hi JohninOttawa,

 

I really did run in some problems. But theese problems were DOS based problems. I did forget that the codes will not accept the "new" long path´s entries which are longer then 6 characters and no special characters as well (see short DOS-path (8.3) ... so I had to rechange the path to a "simple" one and it worked. Now I will try it...

 

See you around. I will mark this as "Problem solved now"

 

Greetings

 

Daniel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Our picks

    • Introducing Ultimaker Cura 3.6 | Beta
      Ultimaker Cura 3.6 | Beta is available. It comes with new features, bug fixes, and UX improvements. We would really like to have your feedback on it to make our stable release as good as it can be. As always, you can download the beta for free from our website, for Windows, MacOS, and Linux.
        • Like
      • 92 replies
    • Print Core CC | Red for Ruby
      Q: For some users, abrasive materials may be a new subject matter. Can you explain what it is that makes a material abrasive when you are not sure which print core to use?
      A: Materials which are hard in a solid piece (like metals, ceramics and carbon fibers) will generally also wear down the nozzle. In general one should assume...
        • Like
      • 30 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!