It is currently Sat Jun 15, 2024 3:14 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 312 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 16  Next
Author Message
 Post subject: Re: Multi-Fill Script Help
PostPosted: Mon Feb 28, 2011 7:05 pm  (#41) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
The nasty things about patterns is that they aren't a "group".

So... I could
-provide a number of pattern picks and randomize those (which makes the dialog big)
-use SG's code to grab files from a directory and load them up as patterns and use them (slow)
-allow a text field where a number of pattern names could be specified to use (lots of possibility for error)

or... if the original issue is having pattern fills always line up, a simple solution might be to randomly offset (and scale?) each layer's fill using the active fill as a base. I'd have to play with this but there is some possibility there....

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Mon Feb 28, 2011 7:10 pm  (#42) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
RobA: Would we be able to determine those picks ourselves? You need me to send you some glass texture images?

Also, I liked the file-glob idea, I just couldn't get it to work, I'd be interested in seeing that code if you got it working.

I'm going to limit myself to easier tasks for script-fu until I get the hang of it.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 3:57 am  (#43) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Well i am all for bigger dialogs, just add a minimize button please. :lol
Provide a number of pattern picks - would be my choice. :)
Add a folder of patterns that come with the script so you can add what you want to it maybe?

Thanks Rob, i am looking forward to seeing the results.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 9:06 am  (#44) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
mahvin wrote:
If you read my original post, my goal was to have my selections fill with random patterns, however, saulgoode mentioned something about pattern file usage being restricted to .pat files, but a lot of my glass patterns are .jpg and .png files. In my thinking process, I limited myself to "patterns" but then got to wondering why does it have to be patterns? Why couldn't it be "images" within a designated folder? I don't have the answer to this, I'm just asking. My idea with patterns was to make them all seamless and alter their sizes to suit the fill parameters, so larger patterns wouldn't overwhelm small selection areas.

I had misinterpreted your intentions and only addressed pattern files in a directory. You may have missed my post-posting edit here (in red text) where I suggested a better approach would be to "load the pattern file as an image, copy it to the clipboard, and fill using the clipboard as pattern". This approach should work equally well for other file formats (assuming they met tiling and sizing requirements).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 9:34 am  (#45) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
That's kind of what myself and PC mentioned earlier also, why not use any image?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 1:51 pm  (#46) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Saulgoode: No. I read your comments. I just couldn't get the script to work. As for filling selections with clipboard content, what would be the point of a script if the process was manual? Or I am not understanding your comment.

I didn't see any script-fu for using clipboard content as fill.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 1:57 pm  (#47) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
mahvin wrote:
Saulgoode: No. I read your comments. I just couldn't get the script to work. As for filling selections with clipboard content, what would be the point of a script if the process was manual? Or I am not understanding your comment.

I didn't see any script-fu for using clipboard content as fill.


You use a pattern fill and set the pattern context. This works even for foreign languages. Some others use "Clipboard" instead of "" but that only works in english:

     (gimp-context-set-pattern (list-ref (cadr (gimp-patterns-get-list "")) 0)) ; set patten to clipboard (first in list)




I'm 90% finished adding a "all images from a directory as random patterns". Just debugging...

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 2:27 pm  (#48) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Ahhhh, this is good to know. I was looking in the PDB for "selections" not patterns.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 2:43 pm  (#49) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
OK - a couple of teasers:
Attachment:
patternfill.jpg
patternfill.jpg [ 63.16 KiB | Viewed 2604 times ]

Attachment:
patternfill2.jpg
patternfill2.jpg [ 62.5 KiB | Viewed 2604 times ]


And the code is attached since it is a big big to inline.

So this version looks for case insensitive jpeg, jpg, png, bmp and pat files. it creates a new invisible image, then loads all the files as layers and randomly sets the fill from those using the clipboard then destroys the temp image. Two One things:

1)it destroys the clipboard contents
2) the clipboard only supports 512x512 px patterns max.

-Rob A>


Attachments:
FlattingTools.scm [15.24 KiB]
Downloaded 175 times

_________________
Image
Fantasy Cartography and Mapping by RobA


Last edited by RobA on Tue Mar 01, 2011 8:50 pm, edited 3 times in total.
Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 2:54 pm  (#50) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Thank you, RobA! I am extremely grateful!

You the man!

Getting this error:
Image

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Last edited by mahvin on Tue Mar 01, 2011 3:24 pm, edited 1 time in total.

Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 3:07 pm  (#51) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Updated the version so clipboard gets replaced.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 3:09 pm  (#52) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
COOL !!

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 3:42 pm  (#53) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I'm still getting the same error. Hmmm...

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 4:23 pm  (#54) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
In investigating "modulo" I only see two instances of it in the palette option, and when I run the Palette option, it works fine, it's only when I use Patterns, it fails. I'm just blabbering because I am curious as to why modulo is having division by zero errors, when different options are used.

All the other multifill options work. I've even copied a pattern to the clipboard in advance, opened a pattern and copied, etc.

Another strange behavior is the SF-DIRNAME option on the multifill menu, each instance of opening it, it changes locations: (example being, each time I open the script for use, the location will be either - .gimp-2.6 or mahvin or patterns. It never remains consistently on one directory location, is this normal?

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 4:44 pm  (#55) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Another question: Since I am using this in Ubuntu, is there a slash direction issue with directories?

string-append has them as backslashes, but Linux uses a forward slash.

EDIT: It didn't make any difference, modulo division by zero error persists.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 6:10 pm  (#56) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
mahvin wrote:
Another question: Since I am using this in Ubuntu, is there a slash direction issue with directories?

string-append has them as backslashes, but Linux uses a forward slash.

EDIT: It didn't make any difference, modulo division by zero error persists.

If you use slashes in Script-fu, the interpreter should perform any necessary conversions (though I am not certain of this since I don't typically use Windows). The best solution is to use the DIR-SEPARATOR constant.

In RobA's latest offering, try modifying all "\\ strings to DIR-SEPARATOR " strings (note that the quotation marks are included in the strings being specified). For example,
        (set! varFileList (append varFileList (cadr (file-glob (string-append inDir "\\*.[pP][nN][gG]") 1))))

becomes

        (set! varFileList (append varFileList (cadr (file-glob (string-append inDir DIR-SEPARATOR "*.[pP][nN][gG]") 1))))

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 6:17 pm  (#57) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
YAY! That fixed it for Linux! Woohooo! Thank you, Saulgoode! And a big big thanks to RobA for getting it to this level.

I am super happy (and impressed!), I can now pre-plan my stained glass orientation for images by using pre-determined color palettes and glass texture alignment. I do this by making several image selection patterns, eliminating the larger selection outlines, and focusing each pattern on their own areas (sky, ground, people, objects), then recombine the patterns to make one whole pattern. This script gives me a lot of room to play with random and specified textures, and see the result before I cut one piece of glass.

Image

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Tue Mar 01, 2011 8:52 pm  (#58) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
I've updated the script with the suggested DIR-SEPARATOR.

Sorry for that, I had cut/pasted from an old script :( (I need to go back and clean them all up me thinks....)

I also added a small change so a folder with no image files will just end up using whatever was in the clipboard rather than generating an error.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Wed Mar 02, 2011 1:18 pm  (#59) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
NICE! Thanks Rob and Saul.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Sun Jun 26, 2011 3:17 pm  (#60) 
Offline
GimpChat Member
User avatar

Joined: Apr 09, 2011
Posts: 1764
it looks pretty...I ended up using the patchwork script and playing with the size of the squares...didnt turn out exactly how I wanted but it was an ok result. But I can see where I could have improved and will remember some things if I try this again


Attachments:
Le_Paradise_Patou_tutorial.jpg
Le_Paradise_Patou_tutorial.jpg [ 62.94 KiB | Viewed 2047 times ]
Top
Post new topic Reply to topic  [ 312 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 16  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Seeking Help with First Multi-File Batch Script

9

No new posts Palette from multi image

2

No new posts Attachment(s) Fill with pattern seamless

13

No new posts Line art detection bucket fill

0

No new posts Filled path not exporting with fill

4



* Login  



Powered by phpBB3 © phpBB Group