Jump to content

Need your help in reconfiguring the dump file folder in python


Recommended Posts

Posted · Need your help in reconfiguring the dump file folder in python

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

  • Link to post
    Share on other sites

    Posted · Need your help in reconfiguring the dump file folder in python

    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) ?

  • Link to post
    Share on other sites

    Posted · Need your help in reconfiguring the dump file folder in python

    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
    Link to post
    Share on other sites

    Posted · Need your help in reconfiguring the dump file folder in python

    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

  • Link to post
    Share on other sites

    Posted · Need your help in reconfiguring the dump file folder in python

    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.

  • Link to post
    Share on other sites

    Posted · Need your help in reconfiguring the dump file folder in python

    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

  • 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

      • UltiMaker Cura 5.4 stable released
        The full stable release of UltiMaker Cura 5.4 is here and it makes it easier than ever to remove brims and supports from your finished prints. UltiMaker S series users can also look forward to print profiles for our newest UltiMaker PET CF composite material!
          • Like
        • 58 replies
    ×
    ×
    • Create New...