Convert Scratch 3 projects to Snap!

I have a problem


turns into

when it should be

is there a way to get all the instruments that are in scratch into snap, and use the same note blocks?

I created a project with all the scratch primitives in it using snapinator. some blocks didn't get converted, so I put the snap primitive that has the same effect as the one in scratch, or made a custom block with no code, but I might come back and make the code for the non snap primitives. here's the link.

(I'm wondering if there's a way to convert snap into scratch)

The 'username' block can be made like this:

Username Block script pic (1)

The 'days since 2000' block would just involve some math, but I'm not sure why someone would use that block anyway.

it'\s in scratch, and I was wondering about that. I've made the username block, but I didn't export it and I can't remember how to make it.

It lets you do things like find the number of days between two dates, or find the day of the week of a date supposing that weren't otherwise available, without having to deal with how many days in a month, is it leap year, etc.

Will you please tell me how to convert BYOB projects?

just open them in snap (I think) just like you can convert .sb and .sb2 files to .sb3 files just by opening them in scratch

Yes, exactly. The conversion isn't perfect and the code was written a long time ago and not looked at since. This software is provided without any warranty, not even an implicit warranty of merchantability or .... that's all I remember.

... fitness for a particular purpose! That's what I forgot. :~)

Importing large Scratch projects into Snap is a challenge. Using the Scratch 3 format (and then snapin8r3) is not an option, as Scratch 3 cannot load large projects. I tried the desktop version of Scratch 3 too, but even a 100MB project is not loaded at all.

Converting Scratch 1.4 projects to BYOB 3.1 has always worked perfectly for me. Now I have very large Scratch projects (200-300MB) that I want to move to Snap. But unfortunately opening ypr project in Snap, as you said, doesn't work well for everything. You can see all the scripts, but the sounds are not imported at all (not so bad for me, I don't have many sounds) and, very important for me instead, as I have tons of images (even long sequences of costumes created by importing "animated gifs"), many images are not imported at all. This is weird, as several images are imported very well whereas some of them are simply empty.

I tried to export the BYOB sprites from my projects, but for some reasons the export fails (and, more importantly, importing even simple BYOB sprites into Snap doesn't seem to work at all). I tried to export just the missing images from BYOB and then to import them into Snap. This works, so there are no algorithmic reasons why the full import should not work. I guess the real problem is just a "size" problem, that is after importing many images no more images can be imported.

What I don't know is if the limit is in the YPR import function, in Snap or in the browser.

So, to know if I can start to work on the YPR import function, I would like to know if there is a limit to the size of projects that can be imported into Snap, due to known Snap limitations or to browser/memory limitations.

Yes, it's possible to run out of the browser's memory quota. As for Snap! itself, there is a limit (100Mb I think) for uploading a project to the cloud, but we don't impose a limit on projects you save on your own computer.

Thanks Brian. How do I know what is the quota assigned by my browser (Chrome) to the projects I can load?

Further details:

  1. Exporting sprites from BYOB doesn't work when the sprite has global variables inside its scripts. Removing the variable reporters from the scripts allows instead to easly export the sprite

  2. Removing all sprites from the project except for the non-exportable sprite and exporting the now-very-small project is not a solution. Indeed, after importing the small project in Snap, the costumes are still empty

This makes me think that there is a problem with the format of the costume images inside the BYOB project. Note: the costumes can be easily exported from BYOB (and imported in Snap, but they are just too many to use this strategy)

If someone is interested, I can share the now-very-small BYOB project

I think you should recruit a 12-year-old to parse the ypr file and pull out the costumes.

Excellent idea :slightly_smiling_face: Is that doable?

One of the few disadvantages of having our own forum instead of mooching off Scratch is that we don't readily get to know the Advanced Topics kids, only a few of whom end up here. Back in the day we had bazillions of 12-year-olds. (Pretty rare to catch them younger, leading me to think there's something to that "Formal Operational" stuff in Piaget.) And we got to keep them all through high school. Once they went to college they got busy.

Let's see who besides me replies to your question...

Thank you for the information.

Unfortunately the Advanced Topics are essentially a ghost town compared to the old days. I suspect it's because the forums are much less visible now that the Discuss has been removed from the header. You probably wouldn't be getting many new faces over there anyway.

Have you tried importing the project into Scratch 2.0, and the converting the SB2 to Snap! with Snapin8r2? Scratch 2.0 tends handle large projects better than Scratch 3.0.

If that fails, trying to extract the images from the YPR file is probably a bad idea. The legacy SB and YPR formats were rather poorly documented, and there were never many tools for working with them compared to SB2. These are my alternative suggestions, from least to most complex:

  1. If Scratch 2.0 can handle it, use it to open and save the project. Change the .sb2 file extension to .zip, and all the images should be in the zip file.
  2. Extract the images from the SB file using https://github.com/tjvr/kurt
  3. Debug and fix BYOB's export code. :slight_smile:

I've avoided working on Snapinator 3 since Scratch 3.0's file format makes me want to bang my head against a wall, but I do plan on implementing SB conversion. So when that's done, it should probably be able to convert your project. I need to do some tech support stuff for my family before I head back to school, but after I finish that up I'll get to work on Snapinator...

Yes. My projects unofortunately are too big even for Scratch 2. Often, when I can open them, Scratch 2 fails then to save them to SB2.

If that fails, trying to extract the images from the YPR file is probably a bad idea.

Extracting the images was just a joke between Brian and me :slightly_smiling_face:. As I said, I have way to many images to think to export and reimport them.

If Scratch 2.0 can handle it, use it to open and save the project. Change the .sb2 file extension to .zip, and all the images should be in the zip file.

Yes, I know. Thanks.

Debug and fix BYOB's export code. :slight_smile:

As Jens knows very well, I'm not a SmallTalk guy at all. That is why I started looking at Nathan's YPR import code two days ago. Unfortunately, Nathan's code is the cryptic Javascript style that I don't love at all. But it is very well organized, so I'm trying to see if there is a problem in the code. My impression is that BYOB and Snap have just two different ways of handling images, and some images that BYOB can show are instead "wrong" for Snap. So it seems to me that the problem is not the image itself but that it must be converted so that Snap can handle it. I don't know yet if this is true and if I can handle the conversion.

I've avoided working on Snapinator 3 since Scratch 3.0's file format makes me want to bang my head against a wall

Really? I don't know the SB3 format at all. Is it so different from SB2? Can you give me some details about the nature of the problem?

I do plan on implementing SB conversion

That will be fantastic. Unfortunately I need to handle this conversion well before mid feburary. Or, at least, I need to try to understand if I have to surrender and stick to BYOB 3 with my students even for this academic year.