Discuss Scratch

-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

I've just finished writing an SB3 to SB2 converter in Python 3, which can be found here: https://github.com/RexScratch/sb3tosb2

If you find any bugs or issues, please tell me. This is also the first time I've written something like this, so I'd appreciate feedback on how to improve the code.

Last edited by -Rex- (March 3, 2019 23:38:15)

SimpleScratch
Scratcher
500+ posts

SB3 to SB2 Converter (working)

:-)
Just tried it on simple project and it worked

https://scratch.mit.edu/projects/287498438

Minor issue - script wasn't visible in scripting area until I'd done a right-click cleanup

WELL DONE
-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

SimpleScratch wrote:

:-)
Just tried it on simple project and it worked

https://scratch.mit.edu/projects/287498438

Minor issue - script wasn't visible in scripting area until I'd done a right-click cleanup

WELL DONE
It was visible for me, although it was shifted to the right. (My screen is 1080p)
NitroCipher
Scratcher
500+ posts

SB3 to SB2 Converter (working)

How do you handle blocks that don't exist in 2.0?

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

It just creates an undefined block with the original inputs and fields.

Some blocks don’t exist but are converted by using a different block and modifying the input, such as
set pen [brightness v] to (input) :: pen stack
set pen shade to ((input) / (2))
...
go to [back v] layer :: looks stack
go back (1.79e+308) layers // ignore the variable reporter
...
go [forward v] (input) layers :: looks stack
go back ((-1) * (input)) layers

Last edited by -Rex- (Feb. 17, 2019 17:52:10)

-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

SVG fill issues have been fixed, although text still doesn't show up properly and the stroke width is often incorrect.
roomhj
Scratcher
16 posts

SB3 to SB2 Converter (working)

I get it.It is very cool apply for me.Thanks.
-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

bump
DipLeChip
Scratcher
1000+ posts

SB3 to SB2 Converter (working)

Your a legend!

stop fuming and start loving :p
-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

A major missing feature has been added: SVG text conversion. Text in vector images will no longer disappear when converted.
-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

Conversion from stereo to mono and downsampling for WAV files has been added.
321RetroGamer
Scratcher
23 posts

SB3 to SB2 Converter (working)

Hi. I tried to use your converter, but after it finished converting “successfully”, the SB2 file I got was blank. Do you know why this is? Is there an error on my behalf?

Last edited by 321RetroGamer (March 2, 2019 03:38:38)

-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

321RetroGamer wrote:

Hi. I tried to use your converter, but after it finished converting “successfully”, the SB2 file I got was blank. Do you know why this is? Is there an error on my behalf?
Could you share the sb3 file?
321RetroGamer
Scratcher
23 posts

SB3 to SB2 Converter (working)

How would I do this? Even so, do you promise not to post it? I've been saving this particular project for a while…
-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

321RetroGamer wrote:

How would I do this? Even so, do you promise not to post it? I've been saving this particular project for a while…
Well, the before doing that, ensure that you've downloaded the latest version. Then run the py file and save the sb2 file to wherever you want using the file dialog. Make sure to open the correct sb2 file afterward. Also, it might help if I knew your Python version. Also, make sure you wait for the Scratch 2.0 editor to fully load, because it shows an empty project before the opened project is fully loaded.

Last edited by -Rex- (March 2, 2019 17:01:30)

321RetroGamer
Scratcher
23 posts

SB3 to SB2 Converter (working)

1. I'm using Python Idle 3.7.2
2. I did let it fully load. The X,Y coordinates were moving (when my mouse moved) and only a default project displayed for over a half an hour.
3. I have now tried with multiple projects to get the same result of a blank project file.

Last edited by 321RetroGamer (March 2, 2019 17:05:13)

-Rex-
Scratcher
500+ posts

SB3 to SB2 Converter (working)

321RetroGamer wrote:

1. I'm using Python Idle 3.7.2
2. I did let it fully load. The X,Y coordinates were moving (when my mouse moved) and only a default project displayed for over a half an hour.
3. I have now tried with multiple projects to get the same result of a blank project file.
What's the file size of your sb3 projects? The program works fine for me (I downloaded it just to test)…
Also, don't use IDLE. Right-click the py file and run it using python instead (or run it from the command line).

Last edited by -Rex- (March 2, 2019 17:07:28)

321RetroGamer
Scratcher
23 posts

SB3 to SB2 Converter (working)

Opened in Python, same result occured. Now I've noticed that the file won't even load. Nothing is overwrited.

Last edited by 321RetroGamer (March 2, 2019 17:16:21)

321RetroGamer
Scratcher
23 posts

SB3 to SB2 Converter (working)

Alright!
321RetroGamer
Scratcher
23 posts

SB3 to SB2 Converter (working)

Sent.

@-Rex-

Last edited by 321RetroGamer (March 2, 2019 17:24:46)

Powered by DjangoBB