This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > PainShop Pro Scripting > August 2006 > Flood Fill missing in Scripts
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Flood Fill missing in Scripts
|
|
| Rachel 2006-08-03, 7:54 pm |
| Does anyone know why none of my scripts that have the flood fill color in
them will do the flood fill...it just skips that step.....I had one script
do it once but when I went to run the script again, it skipped that part.
Thanks!
| |
|
| Rachel wrote:
> Does anyone know why none of my scripts that have the flood fill
> color in them will do the flood fill...it just skips that
> step.....I had one script do it once but when I went to run the
> script again, it skipped that part. Thanks!
It depends on the code; most likely on the size of the (new) image
and the point the floodfill is applied. But it can also depend on
several other things like fore-background color.
Could you post just one of these scripts?
Meanwhile here's an example of Point (1,1), which is always a safe
point no matter the size of your image if you need to fill the whole
canvas.
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.None,
'Material': {
'Color': (0,0,0),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': True,
'Opacity': 100,
'Point': (1,1),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((10,0,3),1)
}
})
Joske
| |
| Spandex Rutabaga 2006-08-03, 7:54 pm |
| Rachel wrote:
>
> Does anyone know why none of my scripts that have the flood fill color in
> them will do the flood fill...it just skips that step.....
How do you know it "skips that step"? Another explanation is that
you recorded the script and used Flood Fill with a Match Mode other
than None. The click point you used was also recorded of course.
Now when you run the script that click point corresponds to a
transparent location at which nothing exists to be matched. There
is no "skipping" of a step. Instead the step happens but has no
visible effect. That is one explanation and a common error made by
people who record scripts. Determining what is actually the problem
depends on seeing what is in the script, but since you are keeping
the scripts to yourself we can't do that.
> I had one script
> do it once but when I went to run the script again, it skipped that part.
I doubt it skipped anything. Stuff doesn't usually happen at random
in software.
> Thanks!
| |
| Rachel 2006-08-04, 7:01 pm |
|
"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:44D2548D.5BE9E86C@agabatur.xednaps...
> How do you know it "skips that step"?
Not knowing anything about scripts, I assume when there is no flood
fill, that it didn't fill.
Another explanation is that
> you recorded the script and used Flood Fill with a Match Mode other
> than None.
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
The click point you used was also recorded of course.
> Now when you run the script that click point corresponds to a
> transparent location at which nothing exists to be matched. There
> is no "skipping" of a step. Instead the step happens but has no
> visible effect. That is one explanation and a common error made by
> people who record scripts. Determining what is actually the problem
> depends on seeing what is in the script, but since you are keeping
> the scripts to yourself we can't do that.
>
Did I offend you in some way? Is there some reason you have to
talk to me like this? "Keeping the scripts to myself" is some sort of
crime? Is it a requirement to post a script when I ask a question? Why are
you insuating that I am stingy? If I am offensive to you, please feel free
to ignore my posts.
>
> I doubt it skipped anything. Stuff doesn't usually happen at random
> in software.
I'm sorry I don't know enough about scripts to use your
proper terminology. I never said or implied that anything happened at
random. I simply said it did not flood fill the selection.
| |
| Rachel 2006-08-04, 7:01 pm |
| Thanks Joske for your generous response. Because of your explanation, I
think I figured it out. Changing the point to 1,1 didn't help beacuse I am
filling a selection. I have noticed that if my selection is not approx. the
same size or the same location on my canvas, it does not fill....but when I
try it again having moved my selection around, it will fill. So I assume
you are correct and it's the point location.
In the future I will make a point to have my selection as close to the same
size as the canvas and in the top left corner of it....will this help?
Thanks again for your response.
This is one of the settings:
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': (189,163,133),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': True,
'Opacity': 100,
'Point': (503.5,555.5),
'SampleMerged': False,
'Tolerance': 200,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((10,0,0),1)
}
})
"Joske" <j.backer@home.nl> wrote in message news:44d24f06$1_1@cnews...
> Rachel wrote:
>
>
> It depends on the code; most likely on the size of the (new) image
> and the point the floodfill is applied. But it can also depend on
> several other things like fore-background color.
>
> Could you post just one of these scripts?
>
> Meanwhile here's an example of Point (1,1), which is always a safe
> point no matter the size of your image if you need to fill the whole
> canvas.
>
> # Fill
> App.Do( Environment, 'Fill', {
> 'BlendMode': App.Constants.BlendMode.Normal,
> 'MatchMode': App.Constants.MatchMode.None,
> 'Material': {
> 'Color': (0,0,0),
> 'Pattern': None,
> 'Gradient': None,
> 'Texture': None,
> 'Art': None
> },
> 'UseForeground': True,
> 'Opacity': 100,
> 'Point': (1,1),
> 'SampleMerged': False,
> 'Tolerance': 20,
> 'GeneralSettings': {
> 'ExecutionMode':
> App.Constants.ExecutionMode.Default,
> 'AutoActionMode':
> App.Constants.AutoActionMode.Match,
> 'Version': ((10,0,3),1)
> }
> })
>
> Joske
>
>
>
| |
|
| Rachel wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> Thanks Joske for your generous response. Because of your
> explanation, I think I figured it out. Changing the point to 1,1
> didn't help beacuse I am filling a selection. I have noticed
> that if my selection is not approx. the same size or the same
> location on my canvas, it does not fill....but when I try it
> again having moved my selection around, it will fill. So I
> assume you are correct and it's the point location.
> In the future I will make a point to have my selection as close
> to the same size as the canvas and in the top left corner of
> it....will this help? Thanks again for your response.
> This is one of the settings:
>[snip]
> 'Point': (503.5,555.5),
>[snip]
The x,y point at which you click on your canvas to prompt the fill
has to be within your selection. Maybe your best bet would be the
centre of the image. I often work in vector, and a vector object can
be aligned to the center of the canvas. A selection from the vector
object would then be safe to fill by clicking in the center of the
canvas.
By the way, thank you for posting in plain text.
Joske
--
http://members.home.nl/j.a.c.backer/
| |
| SuzShook 2006-08-04, 7:01 pm |
| There is a script available, written by Gary Barton, which contains a
function that will find a point in a selection EVERY time, no matter where
the selection is located. The function returns that point, which can then
be used in the Fill command's Point parameter. It works every time. You
can find Gary's script in The Lab at his site here:
http://pixelnook.home.comcast.net/TheLab.html Suz
--
Suz Shook
C-Tech Volunteer
Rachel wrote:[color=darkred]
> Thanks Joske for your generous response. Because of your
> explanation, I think I figured it out. Changing the point to 1,1
> didn't help beacuse I am filling a selection. I have noticed that if
> my selection is not approx. the same size or the same location on my
> canvas, it does not fill....but when I try it again having moved my
> selection around, it will fill. So I assume you are correct and it's
> the point location. In the future I will make a point to have my selection
> as close to
> the same size as the canvas and in the top left corner of it....will
> this help? Thanks again for your response.
> This is one of the settings:
>
>
> # Fill
> App.Do( Environment, 'Fill', {
> 'BlendMode': App.Constants.BlendMode.Normal,
> 'MatchMode': App.Constants.MatchMode.RGBValue,
> 'Material': {
> 'Color': (189,163,133),
> 'Pattern': None,
> 'Gradient': None,
> 'Texture': None,
> 'Art': None
> },
> 'UseForeground': True,
> 'Opacity': 100,
> 'Point': (503.5,555.5),
> 'SampleMerged': False,
> 'Tolerance': 200,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((10,0,0),1)
> }
> })
>
>
>
>
> "Joske" <j.backer@home.nl> wrote in message news:44d24f06$1_1@cnews...
| |
|
| "SuzShook" <suzshook@adelphia.net> wrote in news:44d352ee$1_3
@cnews:
> There is a script available, written by Gary Barton, which
contains a
> function that will find a point in a selection EVERY time, no
matter
> where the selection is located. The function returns that point,
> which can then be used in the Fill command's Point parameter. It
> works every time. You can find Gary's script in The Lab at his
site
> here: http://pixelnook.home.comcast.net/TheLab.html Suz
Is there a way to make Gary's script always pick whatever is in
either the background or foreground materials swatch?
Regards,
JoeB
| |
| Spandex Rutabaga 2006-08-04, 7:01 pm |
| Rachel wrote:
> Did I offend you in some way?
Nope.
> Is there some reason you have to
> talk to me like this?
You don't do common sense things. It is necessary to write more
forcefully to get your attention and compel you to think about
doing what it best for you. That's all.
> "Keeping the scripts to myself" is some sort of
> crime?
No, but it is self-inflicted damage since it makes it harder for
others to help you. It doesn't matter much to me whether you solve
your problem but I'm sure it matters a lot to you. Helping me to
help you is a good plan. Scripts aren't magic. The steps you put
in them have consequences. When someone can see those steps then
they can tell you exactly what's wrong and how to fix it. If you
hide the scripts, people have to guess. It's like wanting your
mechanic to fix your car and then hiding the car from him, i.e.
plain silly. My guesswork about what was wrong was in the correct
general ballpark but it was wrong in detail because you kept the
existence of a selection secret. I can't imagine what benefit you
think accrues to you by keeping these things to yourself.
> Is it a requirement to post a script when I ask a question?
If you have a problem with a script it is extremely sensible to
post the problem script. You aren't compelled to do this any more
than you are prevented from posting in Esperanto, but it makes
more sense to post in English and include the script. It's just
common sense.
> Why are
> you insuating that I am stingy?
What post are you reading? Where did I say that? Quote my words
saying this or stop writing rubbish.
> If I am offensive to you, please feel free
> to ignore my posts.
You aren't offending me. You are making it hard to help you. That's
a silly thing for you to be doing.
> I never said or implied that anything happened at
> random. I simply said it did not flood fill the selection.
Maybe you meant to say that, but go back and read your first post.
The word selection doesn't appear in it. This is one reason that
including the script would have been helpful. Don't be mad at *me*
because *you* did something unwise.
| |
| SuzShook 2006-08-04, 7:01 pm |
| Do you mean for the fill, Joe? Sure. Gary's using a gradient in his
script:
'Material': {
'Color': None,
'Pattern': None,
'Gradient': {
'Name': r'Rainbow',
'GradientType': App.Constants.GradientType.Radial,
'Angle': 0,
'RepeatCount': 0,
'RepeatType': App.Constants.RepeatType.Pad,
'ColorStops': None,
'TransparencyStops': [],
'CenterPoint': (0.5,0.5),
'FocalPoint': (0.5,0.5),
'Invert': App.Constants.Boolean.false
},
'Texture': None,
'Identity': r'Material'
},
'UseForground': App.Constants.Boolean.true,
Just change it to this to always pick the Foreground:
'Material': None,
'UseForground': App.Constants.Boolean.true,
or this to always pick the Background:
'Material': None,
'UseForground': App.Constants.Boolean.false,
Suz
--
Suz Shook
C-Tech Volunteer
JoeB wrote:
> "SuzShook" <suzshook@adelphia.net> wrote in news:44d352ee$1_3
> @cnews:
>
>
> Is there a way to make Gary's script always pick whatever is in
> either the background or foreground materials swatch?
>
> Regards,
>
> JoeB
| |
|
| "SuzShook" <suzshook@adelphia.net> wrote in news:44d38276$1_2
@cnews:
> Do you mean for the fill, Joe? Sure. Gary's using a gradient
in his
> script:
>
> 'Material': {
> 'Color': None,
> 'Pattern': None,
> 'Gradient': {
> 'Name': r'Rainbow',
> 'GradientType':
App.Constants.GradientType.Radial,
> 'Angle': 0,
> 'RepeatCount': 0,
> 'RepeatType': App.Constants.RepeatType.Pad,
> 'ColorStops': None,
> 'TransparencyStops': [],
> 'CenterPoint': (0.5,0.5),
> 'FocalPoint': (0.5,0.5),
> 'Invert': App.Constants.Boolean.false
> },
> 'Texture': None,
> 'Identity': r'Material'
> },
> 'UseForground': App.Constants.Boolean.true,
>
> Just change it to this to always pick the Foreground:
> 'Material': None,
> 'UseForground': App.Constants.Boolean.true,
> or this to always pick the Background:
> 'Material': None,
> 'UseForground': App.Constants.Boolean.false,
> Suz
Thanks. I'll give it a try.
By the way, there is a guy on the usenet group who needs a fast
preset size crop script. I told him you had written one that
would do what he wanted and that he should hop over to the
scripting group here to ask for it. I could have provided a
properly modified version to him but wasn't sure you'd want me to
be posting it on Usenet, which is why I told him to come over
here.
Regards,
JoeB
| |
| SuzShook 2006-08-04, 7:01 pm |
| JoeB wrote:
> "SuzShook" <suzshook@adelphia.net> wrote in news:44d38276$1_2
> @cnews:
>
> App.Constants.GradientType.Radial,
>
> Thanks. I'll give it a try.
>
> By the way, there is a guy on the usenet group who needs a fast
> preset size crop script. I told him you had written one that
> would do what he wanted and that he should hop over to the
> scripting group here to ask for it. I could have provided a
> properly modified version to him but wasn't sure you'd want me to
> be posting it on Usenet, which is why I told him to come over
> here.
>
> Regards,
>
> JoeB
Thanks, Joe - you did the right thing! Suz
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|