This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#151 2012-09-15 15:22:55

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: kurt — Scratch file format Python library

blob8108 wrote:

roijac wrote:

is there any method to get PIL object from an image?

kurt Image.get_image() -> Return a PIL.Image.Image object

smile

edit:
was able to open inspect a .sb in M30W XD
http://i.imgur.com/s5rXF.png
http://i.imgur.com/tXoF9.png
going to commit when i have stage support and all sprite attributes.

#sound, are you going to implement it?

Last edited by roijac (2012-09-15 17:30:33)

Offline

 

#152 2012-09-16 03:32:39

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

roijac wrote:

was able to open inspect a .sb in M30W XD
http://i.imgur.com/s5rXF.png
http://i.imgur.com/tXoF9.png
going to commit when i have stage support and all sprite attributes.

Awesome!  big_smile

#sound, are you going to implement it?

Ah, I might...  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#153 2012-09-19 06:49:57

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: kurt — Scratch file format Python library

blob, are you ok with this and do you want to help me write the article?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#154 2012-09-19 09:12:24

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

Hardmath123 wrote:

blob, are you ok with this and do you want to help me write the article?

Absolutely! Please, go ahead  smile  I guess you can refer to the readme on the Github page — and make sure you mention its de/compiler functionality, too. I'll certainly have a look at it once you're done  wink


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#155 2012-09-19 09:16:42

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: kurt — Scratch file format Python library

Thanks!  smile

EDIT: What do you think? (link above)

Last edited by Hardmath123 (2012-09-19 09:29:17)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#156 2012-09-19 11:24:33

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

Hardmath123 wrote:

What do you think?

It's alright  smile  Thanks for writing it!

Maybe clarify in the first paragraph that it's also a de/compiler? Maybe see the first post...


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#157 2012-09-20 01:53:31

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: kurt — Scratch file format Python library

Better? I'm trying not to make it sound like an advertisement, because that's not what a Wiki is for.

P.S. You have a Wiki account too, you know, so if you think you could improve, go ahead!  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#158 2012-09-20 12:35:57

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

Hardmath123 wrote:

Better? I'm trying not to make it sound like an advertisement, because that's not what a Wiki is for.

Yeah, I know  smile  Thanks!

P.S. You have a Wiki account too, you know, so if you think you could improve, go ahead!  smile

Oh, fine then...  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#159 2012-09-27 18:51:41

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

This is wayyyy to complicated, way to many dependencies.  I installed python, that should have been enough, or I should have found out that there is more before I looked at the readme on github...  I gave up on getting this to work (windows 7) and it caused me to waste many hours today.

You need to make a GUI for this and then compile [i]that[/] into an exe file...

There really is no good way to run this from windows 7... which you did not specify.

Maybe... Maybe... if i install this from Ubuntu, will it get all the dependencies?

Last edited by LiquidMetal (2012-09-27 19:16:25)

Offline

 

#160 2012-09-27 19:29:22

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: kurt — Scratch file format Python library

I was able to run it no problem on windows...


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#161 2012-09-27 19:47:56

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

Well I wasted several hours today trying.  Care to elaborate?

Offline

 

#162 2012-09-27 20:47:17

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: kurt — Scratch file format Python library

I don't know what I did, but it didn't take me more than an hour.  tongue


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#163 2012-09-27 22:09:12

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

That helps... Not.  Did you run the files from the python interpreter?

But does Ubuntu install all the dependencies automatically? In, say, 55 mins then the max it took you  tongue

Last edited by LiquidMetal (2012-09-27 22:12:09)

Offline

 

#164 2012-09-28 06:07:07

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

LiquidMetal wrote:

This is wayyyy to complicated, way to many dependencies.  I installed python, that should have been enough, or I should have found out that there is more before I looked at the readme on github...  I gave up on getting this to work (windows 7) and it caused me to waste many hours today.

You need to make a GUI for this and then compile that into an exe file...

There really is no good way to run this from windows 7... which you did not specify.

Maybe... Maybe... if i install this from Ubuntu, will it get all the dependencies?

Ubuntu should work — try "sudo apt-get install python-pip python-imaging", then "sudo pip install kurt".

I have tested it on Windows 7. It is a little complicated... (I wrote down some instructions somewhere — I'll check them later.) From memory, you need to:
* install Python 2.7 (2.6 might work, too)
* install setuptools/
* Add C:\Python27 and C:\Python27\Scripts (or similar) to your PATH instructions here
* install PIL (make sure you get the Windows installer version)
* You should then be able to simply "easy_install kurt", and it should fetch the remaining dependencies.

...then run "kurtc.py" in Command Prompt/Terminal to check it works!

Sorry there aren't any good instructions!  smile

Last edited by blob8108 (2012-09-28 06:11:51)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#165 2012-09-28 06:12:44

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

MathWizz wrote:

I don't know what I did, but it didn't take me more than an hour.  tongue

Did you have pip installed already? That's the hard part...  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#166 2012-09-28 08:17:54

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

blob8108 wrote:

LiquidMetal wrote:

This is wayyyy to complicated, way to many dependencies.  I installed python, that should have been enough, or I should have found out that there is more before I looked at the readme on github...  I gave up on getting this to work (windows 7) and it caused me to waste many hours today.

You need to make a GUI for this and then compile that into an exe file...

There really is no good way to run this from windows 7... which you did not specify.

Maybe... Maybe... if i install this from Ubuntu, will it get all the dependencies?

Ubuntu should work — try "sudo apt-get install python-pip python-imaging", then "sudo pip install kurt".

I have tested it on Windows 7. It is a little complicated... (I wrote down some instructions somewhere — I'll check them later.) From memory, you need to:
* install Python 2.7 (2.6 might work, too)
* install setuptools/
* Add C:\Python27 and C:\Python27\Scripts (or similar) to your PATH instructions here
* install PIL (make sure you get the Windows installer version)
* You should then be able to simply "easy_install kurt", and it should fetch the remaining dependencies.

...then run "kurtc.py" in Command Prompt/Terminal to check it works!

Sorry there aren't any good instructions!  smile

This is why you need a compiled version with gui.

Offline

 

#167 2012-09-28 08:41:52

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: kurt — Scratch file format Python library

LiquidMetal wrote:

blob8108 wrote:

LiquidMetal wrote:

This is wayyyy to complicated, way to many dependencies.  I installed python, that should have been enough, or I should have found out that there is more before I looked at the readme on github...  I gave up on getting this to work (windows 7) and it caused me to waste many hours today.

You need to make a GUI for this and then compile that into an exe file...

There really is no good way to run this from windows 7... which you did not specify.

Maybe... Maybe... if i install this from Ubuntu, will it get all the dependencies?

Ubuntu should work — try "sudo apt-get install python-pip python-imaging", then "sudo pip install kurt".

I have tested it on Windows 7. It is a little complicated... (I wrote down some instructions somewhere — I'll check them later.) From memory, you need to:
* install Python 2.7 (2.6 might work, too)
* install setuptools/
* Add C:\Python27 and C:\Python27\Scripts (or similar) to your PATH instructions here
* install PIL (make sure you get the Windows installer version)
* You should then be able to simply "easy_install kurt", and it should fetch the remaining dependencies.

...then run "kurtc.py" in Command Prompt/Terminal to check it works!

Sorry there aren't any good instructions!  smile

This is why you need a compiled version with gui.

e.g. M30W...

but that's not that easy to do, PIL and wx will take about 100MB together if freezed, add kurt, PLY, construct and M30W icons and such, and you get about 150MB for 3k lines app xD

Offline

 

#168 2012-09-28 11:57:40

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

I really don't care how big it is.

Offline

 

#169 2012-09-28 12:03:20

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: kurt — Scratch file format Python library

LiquidMetal wrote:

I really don't care how big it is.

well, you don't
but that's pretty annoying to have to upload this file sizes on each commit, so we'll get to it, but only after we got saving and so.

Offline

 

#170 2012-09-28 13:33:33

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

I see.

Offline

 

#171 2012-09-29 17:32:35

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: kurt — Scratch file format Python library

@blub, why do you use floats (0.0) in default_colormap()?
changed it on my machine because I got TypeErrors on 8-bit costumes (chown -R on root ftw?)

Code:

Traceback (most recent call last):
  File "M30W/trunk/core/GUI/menu.py", line 50, in OnOpen
    load(dialog.GetPath())
  File "M30W/trunk/core/load.py", line 26, in load
    costumes.append(Costume(costume.get_image(),
  File "/usr/local/lib/python2.7/dist-packages/kurt/user_objects.py", line 724, in get_image
    (width, height, rgba_array) = self.form.to_array()
  File "/usr/local/lib/python2.7/dist-packages/kurt/fixed_objects.py", line 663, in to_array
    rgba.extend(color)
TypeError: integer argument expected, got float

Offline

 

#172 2012-09-29 17:58:21

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

roijac wrote:

@blub, why do you use floats (0.0) in default_colormap()?
changed it on my machine because I got TypeErrors on 8-bit costumes (chown -R on root ftw?)

Code:

Traceback (most recent call last):
  File "M30W/trunk/core/GUI/menu.py", line 50, in OnOpen
    load(dialog.GetPath())
  File "M30W/trunk/core/load.py", line 26, in load
    costumes.append(Costume(costume.get_image(),
  File "/usr/local/lib/python2.7/dist-packages/kurt/user_objects.py", line 724, in get_image
    (width, height, rgba_array) = self.form.to_array()
  File "/usr/local/lib/python2.7/dist-packages/kurt/fixed_objects.py", line 663, in to_array
    rgba.extend(color)
TypeError: integer argument expected, got float

...ah. I haven't caught this before, through lack of examples to test. Thanks for pointing it out!

I didn't actually write that function, someone else contributed it...  smile  I may have made a mistake when I was merging it. Either way, I'll go fix that...


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#173 2012-09-29 18:04:28

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

Actually, could you try that fix for me quickly? Or send me some 8-bit costumes — I don't have any to hand. Just find-replace every occurrence of 0.0 inside default_colormap with 0 — or copy this. Thanks!  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#174 2012-09-29 20:20:17

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: kurt — Scratch file format Python library

Any chance you could set up a PPA for this?  It would make it much simpler for Ubuntu.

Last edited by LiquidMetal (2012-09-29 20:23:43)

Offline

 

#175 2012-09-30 05:11:39

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: kurt — Scratch file format Python library

LiquidMetal wrote:

Any chance you could set up a PPA for this?  It would make it much simpler for Ubuntu.

Honestly, Ubuntu already has the easiest install procedure:

    sudo apt-get install python-pip python-imaging
    sudo pip install kurt

...and you're done!

vs windows, which takes about six steps and involves editing environment variables...  tongue

So I probably won't make that, no. Thanks for suggesting it, though!  smile

EDIT: I have made a GUI, though, so I've done half of what you asked! Could you please try it out, and let me know what you think? Thanks!

Last edited by blob8108 (2012-09-30 08:41:07)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

Board footer