Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Transfer Codea projects?

edited August 2013 in Questions Posts: 1,976

A random fright just popped into my head... If you get a new iPad, or your old iPad dies, is there a way to transfer all your projects and code to a new iPad, or is all of your work gone forever?

Comments

  • dave1707dave1707 Mod
    Posts: 7,923

    If you have all of your projects backed up on Dropbox or somewhere else, you can just load them on the new iPad. The other apps you purchased or free apps should load from the app store.

  • Posts: 372

    You could also use iFunBox to copy the Documents Folder in Codea. Its the folder which contains all the codes, sprites and shaders. If you lose any data then you can simply paste that folder back into Codea and it will be as it was when you copied the folder.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    If we had a way to create projects via code it would be simple to write one app to backup and load all of your projects. Currently I believe @dave1707 suggestion is best.

  • dave1707dave1707 Mod
    Posts: 7,923

    I already have code to backup my projects. I'm just waiting for the listProject() function so I can do it automatically instead of having to key in each project name. I don't have all of my code backed up because I have over 250 projects and I'm not going to key in that many project names.

  • Posts: 372

    @dave1707 is it possible to back up shaders to drop box without pasting them into a project. What I mean is directly from the shder lab? I backup my projects to drop box using @Ignatz 's code. but only for shaders and sprites I use IFunBox.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @dave1707 wouldn't listProject() just list all project names? I think we would need createProject() to allow backup project to create a new project then save the tabs.

  • Posts: 1,976

    Okay... For one, I'm kind of confused using @Ignatz' backup project. And I don't see any app called iFunBox on the App Store. Is it a Jailbroken app? Because I can't Jailbreak.

  • Posts: 2,161

    @SkyTheCoder What OS do you have on your computer?

  • dave1707dave1707 Mod
    Posts: 7,923

    @Saurabh I haven't messed around with shaders, so I can't say how they could be backed up. @Briarfox listProject() would list all of the projects, just like listProjectTabs() lists all of the tabs in a project. But that would make it easy to backup all of the projects at once. createProject() would come in handy if all of your projects were backed up and you wanted to create them on another iPad or you lost them on your current iPad. But off hand I don't know if there's a way to read all of the files from a sync'd Dropbox automatically. There needs to be a listDirectory() function also.

  • edited August 2013 Posts: 372

    IFunBox is for Mac and PC and no you don't need a jailbreak to backup using it.

  • dave1707dave1707 Mod
    Posts: 7,923

    @SkyTheCoder If you can't get around the problems, you could try the code I have at the link below.

    http://twolivesleft.com/Codea/Talk/discussion/3149/project-backup#Item_3

  • Posts: 1,976

    @Andrew_Stacey I used to use my family's Windows 7 laptop, but now I have my own MacBook Pro. So Mac OS X.

    @dave1707 There's no way to access the shader code in the shader lab except for shader(shader name), but you can use [[ and ]] to make a multiple-line string that can be used as a shader by calling shader(vertex program string, fragment program string). That would require copying back and forth both tabs of all your shaders, though. Also, that project looks like one I was looking for.

  • edited August 2013 Posts: 1,976

    @dave1707 Yes! That project worked, I synced my Dropbox and I have them as files on my computer. Is there any other way to sync them from my computer to my iPad other than maybe making a gist on GitHub?

    Edit: Never mind, didn't finish reading the post ll the way. I didn't even think of accessing the files on my iPad. :P

    Edit 2: I feel a lot safer now, knowing my stuff can be saved.

  • Posts: 2,161

    @SkyTheCoder Install libimobiledevice (can be done via HomeBrew). Then you can mount the Codea Documents directory directly on your machine and simply copy everything across (shaders as well as projects).

  • edited August 2013 Posts: 1,976

    @Andrew_Stacey Is that an iPad app, Mac app, or just one that can be found on the Internet? Also, what is HomeBrew?

    Edit: Haha, thanks Google.

    Edit 2: Dang it, how do you install these kinds of apps? I extract them and it's a bunch of folders and files with no extensions named "AUTHORS," "README," "COPYING," etc.

  • Posts: 580

    Am I missing something? If you are backing up your device regularly (which you should be), then won't restoring that backup to a new device restore all of the apps' data (e.g. your Codea projects) too? I know it's still possible to lose recent work of course, but you'll pretty much have this problem with any other backup solution too. Since you can set your device to automatically back itself up (either to the cloud or directly to iTunes), to me this seems ideal.

  • Posts: 1,976

    My dad never really backs up the iPad, as far as I know.

  • edited August 2013 Posts: 580

    Like I said, it's not hard to set it up to do it through iCloud. The iPad should detect whenever your device is plugged in, locked, and connected to wifi, and should automatically back itself up :)

  • Posts: 2,161

    @SkyTheCoder Learn Unix, it'll open up a whole new world for you. You'll look on with pity, and a little smugness, as everyone complains about how their computer does weird things when your computer does exactly what you want it to.

  • Posts: 580

    @Andrew_Stacey: just noticed your plug for libimobiledevice....awesome! Didn't even know it existed.

  • dave1707dave1707 Mod
    Posts: 7,923

    @SkyTheCoder I modified my original program to make it easier to backup files. Just enter the project name in the text parameter and then press "Save Project".


    function setup()     parameter.clear()     parameter.text("projectName","")     parameter.action("Save Project",saveProject) end function draw()     background(40,40,50) end function saveProject()     output.clear()     fileName=projectName..".txt"     file = os.getenv("HOME").."/Documents/Dropbox.spritepack/"..fileName     data=""     tabList=listProjectTabs(projectName)     if #tabList>0 then         for a,b in pairs(tabList) do             data=data..string.format("\n--# %s\n",b)             data=data..readProjectTab(projectName..":"..b)         end         wFd = io.open(file,"w")         wFd:write(data)         wFd:close()         print(projectName.." -- save complete")         setup()     else         print(projectName.." -- invalid project name")     end end
Sign In or Register to comment.