It is currently Mon Jun 15, 2026 5:35 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: random-shapes.py
PostPosted: Sun Jan 20, 2013 3:08 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
i'm trying to use random_shapes.py working in gimp 2.8
previous version i had went into error for "integer expected got float"
downloaded the one under sourceforge - more recent, rel oct 07 and supposed to be updated to run under gimp 2.8 - and it crashes without even showing input panel : error msg:
"Plug-in crashed: "random_shapes.py"
(C:\Users\User\.gimp-2.8\plug-ins\random_shapes.py)"
Does somebody know what's wrong with that plugin? thanks
(i posted a question also under sourceforge, but it seems they are not so responsive as you gentlemen are
thanks

_________________
"Where am I ?"


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: random-shapes.py
PostPosted: Sun Jan 20, 2013 3:24 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
dinasset wrote:
i'm trying to use random_shapes.py working in gimp 2.8
previous version i had went into error for "integer expected got float"
downloaded the one under sourceforge - more recent, rel oct 07 and supposed to be updated to run under gimp 2.8 - and it crashes without even showing input panel : error msg:
"Plug-in crashed: "random_shapes.py"
(C:\Users\User\.gimp-2.8\plug-ins\random_shapes.py)"
Does somebody know what's wrong with that plugin? thanks
(i posted a question also under sourceforge, but it seems they are not so responsive as you gentlemen are
thanks

Would you have a URL to the file?

_________________
Image


Top
 Post subject: Re: random-shapes.py
PostPosted: Sun Jan 20, 2013 3:38 pm  (#3) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2603
Not a gimp plugin

Image


Top
 Post subject: Re: random-shapes.py
PostPosted: Sun Jan 20, 2013 6:51 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
The only version I have was posted by Werner Hartnagel 2006/10/23 Random Shapes plugin for The Gimp 2.3 it's old and fails?

file deleted by graechan

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Sun Jan 20, 2013 10:07 pm, edited 1 time in total.

Top
 Post subject: Re: random-shapes.py
PostPosted: Sun Jan 20, 2013 7:25 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Graechan wrote:
The only version I have was posted by Werner Hartnagel 2006/10/23 Random Shapes plugin for The Gimp 2.3 it's old and fails?

Attachment:
random_shapes.zip


Most numbers returned by the dialog are not ints but floats, so as a safety measure you can cast them all to int:
mySVG = randomSVG(svg_filename, int(width), int(height), int(interation), int(shape_position), palette_colors)


Hmmm. It's generating an SVG file and then loading it, instead of generating the shapes directly as vectors....

_________________
Image


Top
 Post subject: Re: random-shapes.py
PostPosted: Sun Jan 20, 2013 10:12 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I have deleted the file Ofnuts as I only posted for you to check, I'll leave it to you to decide if it's worth modifying and saving

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: random-shapes.py
PostPosted: Mon Jan 21, 2013 1:19 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
thanks to everybody
the url from where i downloaded the last version is:
http://sourceforge.net/projects/randoms ... rce=navbar
the code in that python module is:
import random
import turtle
from turtle import *
#shapes = random.randrange(5, 50)
shapes = int(raw_input('How many Shapes '))
turtle.screensize(100, 100)
colormode(255)
r = random.randrange(0, 255)
g=random.randrange(0, 255)
b=random.randrange(0, 255)
bgcolor(r,g,b)
scount = shapes
LengthU = 600
LengthL = 590
while scount != 0:
r = random.randrange(1, 255)
b = random.randrange(1, 255)
g = random.randrange(1, 255)
fillcolor(r,b,g)
pencolor(r,b,g)
sides = random.randrange(3, 12)
angle = ((sides-2)*180)/sides
angleO = 180-angle
count = sides
length = random.randrange(LengthL/sides, LengthU/sides)
if LengthL-20 !=20:
LengthL -=20
if LengthU-20 !=30:
LengthU -=20
x = random.randrange(-250,250)
y = random.randrange(-250,250)
lastx = x
lasty=y
penup()
turtle.setx(x)
turtle.sety(y)
pendown()
turtle.fill(True)
while count!=0:
forward(length)
left(angleO)
count-=1
scount-=1
turtle.fill(False)
while 1:
temp=0

using python console it seems that module turtle is non accepted (i have a turtle.py in the python library)

i'm not a plugin developer: is this NOT a plugin for gimp?
thanks

_________________
"Where am I ?"


Top
 Post subject: Re: random-shapes.py
PostPosted: Mon Jan 21, 2013 2:34 am  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Certainly not... Gimp plugins must use a specific python-to-gimp library, and tell Gimp about their contents, so they contain a line that says "from gimpfu import *" and at least one "register(...)" call.

_________________
Image


Top
 Post subject: Re: random-shapes.py
PostPosted: Mon Jan 21, 2013 5:54 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
OK, thanks Ofnuts, i will stay w/o that (the older version which was probably a gimp plugin was not updated for gimp 2.8, so it crashed)

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group