GIMP Chat http://gimpchat.com/ |
|
Multi-Fill Script Help http://gimpchat.com/viewtopic.php?f=8&t=1221 |
Page 2 of 16 |
Author: | saulgoode [ Sun Feb 27, 2011 10:57 pm ] |
Post subject: | Re: Multi-Fill Script Help |
You need to post some code. |
Author: | mahvin [ Sun Feb 27, 2011 11:07 pm ] |
Post subject: | Re: Multi-Fill Script Help |
Code: Select all (define (script_fu_MultiFill img inLayer inColour inThresh inRandom inPalette inIgnoreSize inFlagSize inFlagColour inHowCheck inMakeCopy inFlatten inPatternDirectory) |
Author: | saulgoode [ Sun Feb 27, 2011 11:48 pm ] |
Post subject: | Re: Multi-Fill Script Help |
The position of each of your parameters in the define statement need to match up with the position of its corresponding argument specified in the 'script-fu-register' call (e.g., if inPatternDirectory is the last parameter then SF-DIRNAME should be the last argument). Also, the value of SF-DIRNAME should be just a directory, no filename (or wildcard pattern). |
Author: | mahvin [ Sun Feb 27, 2011 11:59 pm ] |
Post subject: | Re: Multi-Fill Script Help |
Error: Invalid number of arguments for file-glob (expected 2 but received 1) Just considering the code changes, and seeing I am not meeting the arguments, I get the feeling I need another toggle for files. I even entered what I would consider a legal use of file-blog on the script-fu console and got the same error as above. |
Author: | mahvin [ Mon Feb 28, 2011 2:09 am ] |
Post subject: | Re: Multi-Fill Script Help |
Ok, this file-glob issue is irritating, but it's not going to scare me off. In the script-fu console, this: (file-glob "/home/mahvin/.gimp-2.6/patterns/*") gives me this: Error: Invalid number of arguments for file-glob (expected 2 but received 1) But when I add a numerical value 0 or 1: (file-glob "/home/mahvin/.gimp-2.6/patterns/*" 1) It properly gives me the entire contents of my patterns folder: > (file-glob "/home/mahvin/.gimp-2.6/patterns/*" 1) (173 ("/home/mahvin/.gimp-2.6/patterns/tumor.bmp" etc etc etc... When I make the same attempt with the multifill script it gives me a new argument error: Error while executing script_fu_MultiFill: Error: eval: unbound variable: fill-type UPDATE: I added (fill-type 0) to let* and now... I got it to make a copy, and start fuzzy selections, but it goes into an infinite loop on the first selection, and I can't see what its filling with (pattern fill option) because its not working on the drawing. |
Author: | mahvin [ Mon Feb 28, 2011 4:50 am ] |
Post subject: | Re: Multi-Fill Script Help |
I know I am on the right track, file-glob needed a value, I just don't know why it needed a value and what that value should be. I added 1 for a value because I saw that value being used a lot on other scripts using file-glob. "fill-type" wasn't in the let* statement, so I added it there and the script finally ran, but as promised, you (Saulgoode) said it wouldn't work, and now I agree, it doesn't work right. This is actually fun, I miss the excitement. Here's a video of the script in action, this is mainly for those of you, who are keeping an eye on things: (As always, best viewed on YouTube in fullscreen mode) Video from : www.youtube.com The let* statements: Code: Select all (let* |
Author: | saulgoode [ Mon Feb 28, 2011 5:06 am ] |
Post subject: | Re: Multi-Fill Script Help |
mahvin wrote: I know I am on the right track, file-glob needed a value, I just don't know why it needed a value and what that value should be. I added 1 for a value because I saw that value being used a lot on other scripts using file-glob. The second value (sorry 'bout forgetting it) determines whether the returned filename strings are straight ASCII (1) or UTF-8 (0) encoded. mahvin wrote: "fill-type" wasn't in the let* statement, so I added it there and the script finally ran, but as promised, you (Saulgoode) said it wouldn't work, and now I agree, it doesn't work right. This is actually fun, I miss the excitement. Oops. I should probably have stated that 'fill-type' is a parameter of the main function and corresponds to the value of the SF-OPTION "Fill Mode" argument. The general syntax of SF-OPTION is: Code: Select all SF-OPTION "Label" (list "arg set to 0" "arg set to 1" "arg set to 2") Note: if you want to follow RobA's naming practice of using camel case, 'fill-type' should probably be called "inFillType" or somesuch. Traditional Scheme style guidelines, however, prefer all lowercase with words separated by hyphens. |
Author: | mahvin [ Mon Feb 28, 2011 5:35 am ] |
Post subject: | Re: Multi-Fill Script Help |
Ok, I have a hit and miss situation taking place now. I added inFillType to main parameters (changing each instance of fill-type), and it threw the script off on arguments, since your edit reduced the need for the random colour toggle. I added the toggle back to see if it would satisfy the arguments and it did, but the script still gets stuck on the first fuzzy select selection and loops there. Hmmmm... |
Author: | saulgoode [ Mon Feb 28, 2011 8:38 am ] |
Post subject: | Re: Multi-Fill Script Help |
Try substituting '(255 0 144) for the "magenta" in the SF-COLOR line (and double-check your argument/parameter alignments). Also, there is no need for the "random" checkbox because that option is offered by the dropdown SF-OPTION. |
Author: | mahvin [ Mon Feb 28, 2011 2:29 pm ] |
Post subject: | Re: Multi-Fill Script Help |
I notice you have 3 instances of this in your code on page 1: (gimp-edit-fill inLayer FOREGROUND-FILL) whereas the original script didn't. I made the changes you suggested, and removed "inRandom" from the main parameters since it was no longer being used. So, I learned something by looking closer, but still stuck at one fuzzy select looping. |
Author: | mahvin [ Mon Feb 28, 2011 3:12 pm ] |
Post subject: | Re: Multi-Fill Script Help |
When I choose random colors, it loops on the first fuzzy select selection but fills the selection with random colors. When I choose palette colors, it crashes: Plug-In 'MultiFill' left image undo in inconsistent state, closing open undo groups. When I choose Patterns, it loops on the first fuzzy select selection, but doesn't fill the selection with color. |
Author: | Rod [ Mon Feb 28, 2011 3:34 pm ] |
Post subject: | Re: Multi-Fill Script Help |
I actually have the same problem with Robs original script. I downloaded it, created a wall with a bunch of bricks, selected all the bricks with fuzzy select - ran the script and it looped endlessly forever on one brick.Then the script created one black layer, and kept looping forever after that. I do not think its your pattern addition to the script that causes it, i believe its always been there in the original. |
Author: | Rod [ Mon Feb 28, 2011 3:36 pm ] |
Post subject: | Re: Multi-Fill Script Help |
How exactly are you supposed to use the script? Select every area then run it, or select one area at a time? |
Author: | RobA [ Mon Feb 28, 2011 3:40 pm ] |
Post subject: | Re: Multi-Fill Script Help |
I've come to the party late I've got a newer version than the one at the plugin registry. You might want to use it as a starting point, or I can add the feature you are interested in.... This added a bunch more options including to fill each space with a random direction gradient. This was done to make nifty heightfields for bumpmapping (I was using it to make tile floors - attached is a sample) Attachment: tiles.png [ 652.25 KiB | Viewed 3004 times ] Code: Select all ;flattingtools.scm -Rob A> |
Author: | mahvin [ Mon Feb 28, 2011 3:49 pm ] |
Post subject: | Re: Multi-Fill Script Help |
This is using the original script with a brick wall on palette setting (just for verification, random colors works as well, just didn't see the need to post two images): Whoa, didn't see your post RobA. I was just feeling like I was biting off more than I could chew with something of the pattern fill magnitude. Theories and realities = chasms apart in regards to simplicity, for noobs like me. How much work would it take for you to add that option to this script? I'd appreciate it. |
Author: | RobA [ Mon Feb 28, 2011 3:54 pm ] |
Post subject: | Re: Multi-Fill Script Help |
Rod wrote: I actually have the same problem with Robs original script. I downloaded it, created a wall with a bunch of bricks, selected all the bricks with fuzzy select - ran the script and it looped endlessly forever on one brick.Then the script created one black layer, and kept looping forever after that. I do not think its your pattern addition to the script that causes it, i believe its always been there in the original. You don't select anything first. The colour parameter is the selection. It makes its own selection, then break it apart. The default settings will work with black lines on white, all one layer as if you scanned a drawing in. -Rob A> |
Author: | mahvin [ Mon Feb 28, 2011 3:58 pm ] |
Post subject: | Re: Multi-Fill Script Help |
You ninja'ed me, RobA, only I didn't get the option of seeing your post before I submitted my own, so I had to change my comments in my post above yours. 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. |
Author: | Rod [ Mon Feb 28, 2011 5:25 pm ] |
Post subject: | Re: Multi-Fill Script Help |
yup i figured that out after about 3 trys Rob, sorry about my confusion Anyways this new one is awesome! Is there a Pulitzer for Scheme writers? |
Author: | Rod [ Mon Feb 28, 2011 5:26 pm ] |
Post subject: | Re: Multi-Fill Script Help |
Can you add patterns and any other image to the list |
Author: | Rod [ Mon Feb 28, 2011 5:36 pm ] |
Post subject: | Re: Multi-Fill Script Help |
i like it! now that i know how to use it |
Page 2 of 16 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |