Define Pattern useless in an Action?

DP
Posted By
Daryl_Pritchard
Feb 14, 2004
Views
2215
Replies
26
Status
Closed
Hello all,

I recently created an action in which a small file is first generated to produce a color grid that I then define as a pattern named, for example, "Color Grid". I next cleared the image area and resized the canvas to a much larger size, where my intent was then to select the Fill Tool with the pattern option and "Color Grid" chosen as the pattern.

While this worked fine when performed manually, the action always failed on playback, providing an error of "Could not fill because no pattern has been defined." when the fill was being attempted. In both the Make Pattern step of the action and in the Fill step, the pattern name is correctly shown, yet I do notice that the Fill step also shows a "Pattern Id" that his a long number which I’m guessing is generated as a unique number for each pattern, even those which are identical.

Could it be that when the action was recorded, the pattern was assigned this unique ID that, upon deletion of the pattern is no longer available for reference by the action? If so, that would seem to be a flaw in how Photoshop (both 7 and CS, and perhaps earlier versions) references patterns used in actions. It seems to me that the user-defined pattern name should be the only identifier needed.

Is there something else I’m overlooking that is causing this situation?

Thanks,

Daryl

Powered by Creative Market

Y
YrbkMgr
Feb 14, 2004
Daryl,

I’ve read this about five times and must be having a mental block. If it’s not too much trouble, list out the steps of the action, then point out where the error occurs. I can’t figure out exactly what you’re doing, so contributing to a solution is challenging.

Peace,
Tony
Y
YrbkMgr
Feb 14, 2004
Here’s what I did…

File|New… created a 300 x 300 image with transparent background.

Start recording.

Place guides at canvas center (an action I have), the sequentially fill each of four quadrants with a color (I chose red, green, blue, and yellow), using the marquee tool and snap to guides for placement of the colors.

Next, select All, Edit|Create Pattern… named "color fill".

Select All, delete (now on transp bkgrnd), Image|Image Size… made it 1024 width with propr constrained.

Click on Paint Bucket choose Pattern in options bar, select Color Fill Pattern, click in image (still transparent).

It fills the whole thing with my pattern.

I stop recording.

I created a new image the same size as the original (300×300), then play the action. Works fine. Of course, it keeps recreating the "color fill" pattern…

Are you in CS or PS7?

Peace,
Tony
DP
Daryl_Pritchard
Feb 14, 2004
Tony,

Here is an abbreviated sequence of steps:

1. Create a small file (50×50 pixels), and add some blocks of color to it.

2. Using the file as the pattern, select Define Pattern and name it "Color Blocks"

3. Select All and Clear the image to a white background.

4. Resize the canvas to a larger size (500×500 pixels)

5. Use Fill Tool or Fill Command, with the pattern option and the pattern "Color Blocks" selected, and fill the canvas.

It is on this last step that the action fails. Now, I can’t say I’d made the connection until this action worked as I went in and recorded a new one, but it appears that it doesn’t fail unless Photoshop has been closed and reopened. Also, whether or not the patterns previously created by the action have been deleted seems to make no difference. Another thing I hadn’t noticed until now, is that if multiple instances of the pattern are created as the result of rerunning the action, each pattern does have the same name, so that somewhat explains the need for the Pattern ID that I saw associated with it in the Fill step of the actions pallette.

Since the action creates a pattern and then attempts to use the pattern all within the same open session of Photoshop, I don’t understand why the failure occurs.

Here is a simplified action that performs what I describe: <http://jazzdiver.com/photoshop/Action_Pattern_Problem.atn>

Edit: Seeing your added message, I’d never thought of using the guides for this purpose of adding blocks of filled color. That is easier than the series of selection transforms I peformed, although both work. You’ll see from my previous comments that it is the closure and reopening of Photoshop that appears to be the factor, and I’ve observed this in both PS7 and PSCS.

Thanks,

Daryl
Y
YrbkMgr
Feb 14, 2004
Daryl,

I see it now, and you’re right.

First of all, you DO realize that your action will create a new pattern every time it is run right? Are you sure you want to do that? It doesn’t seem like one would, else you would end up with five of the same pattern if you run it five times.

So based on that alone, you may want to re-think your strategy for automating whatever it is you’re automating.

My theory is, that since you are re-creating the pattern itself every time that the action is run, it is always assigned a new pattern ID, thus, the previous pattern ID being called doesn’t exist between sessions. I haven’t noodled that one out completely, but that’s my guess.

Point is, I would be leary of including the creation of the pattern in the action unless there’s a compelling reason to do so, in which case there may be another way to automate this, if you explain what you’re trying to accomplish – i.e., why you want a pattern created each time the action is run.

If you choose one of the patterns that ship with Photoshop in your last step, the action runs flawlessly, even though it creates the CMYK blocks pattern – that leads me to believe that until you use the Preset Manager to Save the pattern, or pattern set, that the Pattern ID is going to change between sessions.

IOW, double click on the pattern in your last step to re-record this step and bring up the dialog. Choose the first pattern that’s displayed, and complete the action. Then close PS and re-open it, and the action runs fine.

Peace,
Tony
DP
Daryl_Pritchard
Feb 14, 2004
Hi Tony,

Yes, I know there’s a flaw in the process of redundant patterns being created. This action I was building wasn’t one to be used often and would been provided with the instruction to delete the new patterns after use. What I’m doing, rather than provide an action and a base image to apply it to, is providing an action that generates an image all on its own, as part of an action to be run for timing Photoshop’s performance to completion. You’ll see word about it again later when I’ve got things ready to start collecting information.

I’ve geen exploring this problem more and have seen the same thing you report…that canned patterns work fine with this action. That’s odd but yet may well be explained as per your comments.

My original intent in the action was not only to create a named pattern, but also to delete it at the end of the action. But, that doesn’t appear to be possible becase the Delete Pattern command merely references the pattern by its depth into the pattern table, which would obviously vary from one system to another.

Thanks,

Daryl
Y
YrbkMgr
Feb 14, 2004
<nodding> Gotcha. Would it help to save the pattern using preset manager? I’m betting that’s where the Pattern ID is "fixed". I’m not sure how you could incorporate that into your action or if you should. You might want to provide the pattern AND the action for your timing puposes.
DP
Daryl_Pritchard
Feb 14, 2004
I gave the Pattern Manager a look and couldn’t find it to add any useful value. I guess I’ve gone on a bit too long with this though, as I actually wound up rewriting my action without using Define Pattern. Oh, I failed to mention that didn’t I? Ha! Well, this problem still bugged me apart from that I wound up taking a different direction. I just made my resized canvas smaller than originally intended, then duped the original block of colors to multiple layers, offsetting each as needed to fill the larger canvas, then flattening it all. Perhaps not an elegant approach, but just something more for PS to chew on.
Y
YrbkMgr
Feb 15, 2004
<nodding> Interesting…

I presume that Pattern Manager is a new feature of CS. I’m still in 7.
PC
Patty_Clarke
Feb 15, 2004
Enjoyed listening in on this exchange of info between the "smart people." Daryl, I am just getting to "know" the CS version–I would like to know more about the Pattern Manager and practical useage you refer to.

Patty 🙂
DP
Daryl_Pritchard
Feb 15, 2004
Hi Patty,

Perhaps you misunderstood me, as I meant to be saying that for what I was discussing here, the Pattern Manager did not appear to be a practical solution. The problem I found was that, just as when deleting a pattern from the drop-down menu on the Options bar, the deleted pattern is not deleted by name but rather by index position in the table of patterns. Now if the Pattern Manager had made it possible to select or delete a pattern by the user-defined name, then perhaps it would have been of practical use for me.

Regards,

Daryl
PC
Patty_Clarke
Feb 15, 2004
Daryl,

My bad…properly stated my question would be–

I would like to know more about the Pattern Manager and the NON-practical useage you refer to. In other words, you’ve done research–what can this function be used for??

Patty 🙁
DP
Daryl_Pritchard
Feb 15, 2004
Patty,

I’ve not researched the Pattern Manager too much yet; in fact, as I return to look at it again, I notice that I’ve renamed it in the course of these postings. It is actually the Preset Manager, from which groups of patterns can be loaded, saved, or deleted as pattern sets. The Preset Manager was introduced in PS7 as I recall and continues on in PS8. I don’t use patterns much, but the Preset Manager could be a quite practical tool if you do find yourself needing to swap between pattern sets form some reason. Not allowing you to delete a pattern by user-defined name is the main thing I find impractical about it.

Daryl
Y
YrbkMgr
Feb 15, 2004
AHA! Okay, so it’s the preset manager. That was introduced in version 6, I believe.

Not allowing you to delete a pattern by user-defined name is the main thing I find impractical about it.

I dunno. I don’t mean to sound argumentative, but frankly, for those who use patterns often, and use the presets manager to manage sets of patterns, deleting by name is anything but practical, IMO.

Think about it, when, exactly, would one call (for deletion or for implementation) a pattern by name v. point and click? Think of it like styles – would you delete a style by name?

I use the presets manager to manage literally hundreds of patterns that I’ve created for different purposes. I unload them or load them as needed, depending on the project I’m working on. So for me, it’s quite useful, but I cannot think of a single situation in which deleting one, by name, would be practical.

Again, I’m not trying to be combative, I just don’t necessarily agree.
NB
Norbert_Bissinger
Feb 15, 2004
Daryl
Delete the last step (Fill) in the action.
Highlight the step before (Reset Swaches) and start recording this step: Edit>Fill. You should see the Pattern Dialog Box: select your pattern and click OK. (If your Pattern is not there you did not make one.) Stop the action.
Y
YrbkMgr
Feb 15, 2004
Ya know, that hadn’t ocurred to me Norbert. Great catch. Explicity selecting the action will call the correct Pattern ID from the palette. It’s odd that it doesn’t work Daryl’s way, but it certainly makes sense that explicity selecting the pattern would work.
PC
Pierre_Courtejoie
Feb 15, 2004
Tony, did you send an e-mail to DannyR about this? (or I’ll do it)
DP
Daryl_Pritchard
Feb 15, 2004
Tony,

I know you’re not being combative, so no worries there. I can easily see the usefulness of being able to manage pattern sets for various tasks and perhaps it is just my lack of using them very often that finds me surprised that an individual pattern cannot be deleted from a set. I don’t imagine that would be something very often used, but it still seems to me that, be it by name or something else, there should be a way for the user to explicitly reference once specific pattern for deletion. Obviously the pattern ID is not practical. The pattern name would be, if not for that duplicates of the same pattern still use the same name. As I mentioned before, when the Delete command is issued from the Presets Manager, the result is that an index position for the pattern is used. That is, if the action created the CMYK Blocks pattern as the 10th pattern in the current pattern set, then the recorded step in the action for a deletion of the pattern is "Delete pattern 10". Again, that’s not useful since the number of patterns in the current set may vary by the system the action is run on.

So, all in all, I would contend that this is a "bug" of sorts…a minor, innocuous one perhaps, given the infrequency of use. However, while I do not often write actions, I do like knowing that any action that creates some sort of saved item that becomes part of the PS toolset can also clean up its tracks by deleting that item at the action’s end.

Norbert,

I can’t see that use of the Fill command makes any difference. You may have missed it, but in my outline of steps in the 3rd posting, the 5th step references using either the Fill Tool (bucket) or the Fill Command (Edit menu). Regardless of the approach used, I still find that the same error arises regarding the pattern not being defined when, in truth, it is.

I’m convinced the problem lies in the Pattern ID. Why? Because if one goes through and creates this action and then uses it within the same session of PS, there is no problem. But, close and reopen PS, and that previously recorded Pattern ID is now apparently meaningless. Even if the defined pattern is left intact in the pattern set from a prior PS session, it still isn’t recognized. Similarly, if the action is used by someone else on their system, the action will define a new pattern just fine, yet the Fill step will still be calling out the unique Pattern ID as generated when I recorded the step. It is this latter observation that strikes me as having broader ramifications among those who develop actions.

Another oddity, but probably just some sort of caching of a pattern, is that a deleted pattern remains usable if it is still indicated as the selected pattern in the options bar for the Fill Tool. The same is true of brushes or shapes.

I don’t know that I see any solution to the problem that I’ve found here. Perhaps noone would actually think of it as being a problem, I’m not sure. Given the number of PS users, I find it unlikely that I’d be the only one who would come across this situation, especially considering that there are bound to be many more folks who are more involved in creating actions than I am.

Regards,

Daryl
Y
YrbkMgr
Feb 15, 2004
Daryl,

Since you understand that I’m not being combative, then I’ll blurt it out. You’re approaching the task in a bohemian way. It follows the idea that sometimes people want to automate a project to be done in a particualar sequence, or a particular way, instead of looking for a way that captializes on the advantages of the system itself. I’m not going into a long winded "automation strategy" conversion, but the point is, from what I can tell, you are trying to do something in a way that it shouldn’t be done.

I know you have some higher purpose for what you’re doing, but your approach is going to lead to problems based on the way photoshop works.

it is just my lack of using them very often that finds me surprised that an individual pattern cannot be deleted from a set.

It can, quite easily, several different ways. I don’t understand why you think they cannot be deleted from a set, I do it all the time.

I would contend that this is a "bug" of sorts

I disagree. There are many things, related to the intereface and choices one cannot make that cannot be controlled from an action. For example, you cannot create an action that creates an action.

Why did I use that example? Simply to point out UI functionality as it relates to actions – specifically, there is NEVER an instance where you would be able to type the name of a pattern, and select it or delete it. It’s all part of the UI and list picking.

But that’s not the point…

I do like knowing that any action that creates some sort of saved item that becomes part of the PS toolset can also clean up its tracks by deleting that item at the action’s end.

You use the word "clean up", I use the word "delete". I don’t want it deleting my patterns.

I still find that the same error arises regarding the pattern not being defined when, in truth, it is.

Not if you do this:

First, reset yourself by selecting the Paint Bucket tool, then go to the options bar, select pattern, and choose the first pattern in the drop down. Now set it back to Foreground. That just reset’s your starting condition.

Use the presets manager to delete your CMYK Blocks patterns that you’ve created, if any, over time.

Re-run your action so that it errors out at the fill step.

Next double click on the fill step to begin recording and bring up the pattern picker dialog. Select the CMYK block that was just created by the action.

Here’s where you are: You have created a CMYK Block pattern, and your action will call that specific pattern. Close photoshop and reopen it.

You will see that two things happen. 1, your action runs without error. Two, you will have a duplicate CMYK Block pattern.

Now as I read it, your contention is, that you should be able to delete a pattern using an action. I contend that you should NOT be able to do this. I do not want an actions to be able to delete styles, patterns, brushes, or actions, for that matter. I also do not want actions to be able to save or delete patterns or pattern sets on my hard drive.

All those patterns are managed from the various PSP files.

So I say again, your approach is fundamentally flawwed (sorry to say it like that), since you know what you want to accomplish, but you think it should be able to be accomplished in a specific way.

There is probably an automated solution, but we don’t know enough about why you’re doing what your doing to offer up an alternative, but I can tell you without a doubt that it’s not a bug, of any kind, it’s a feature <smile>

Peace,
Tony
NB
Norbert_Bissinger
Feb 15, 2004
Daryl
I took a look at your 3rd post and I wrote the steps different and it fills. Here is what I did:

Before making the Patterns I made a new layer and created the color blocks on this layer. Then I defined the Pattern. Now instead of clear I deleted the layer. After risizing the canvas it fills.

Norbert
DP
Daryl_Pritchard
Feb 15, 2004
Tony,

There’s no problem in calling my approach flawed. It seems it is. I do understand patterns can easily be deleted from a set…I goofed and didn’t clarify that I meant from within an action. As you suggest though, perhaps that is for good reason. I wouldn’t really have thought it such a big deal to create and delete a pattern within an action, but I definitely buy the argument that perhaps it is indeed safer not to have the ability to delete such UI items, lest something go awry and delete more than was intended.

Good "fix"! I’m surprised that you’d have to reset the options to get the pattern to define properly so that the action works as intended. That must’ve taken a bit of time to isolate…I’d never have thought to go there.

Thanks for pointing out that some of the downloadable Actions from the Adobe Exchange do incorporate creating a pattern. They do sound worth studying.

OK…problem solved. As for not being able to delete a pattern from within an action, I’ll think I can go along with calling that a "feature", but inside I’ll still think of it as a little bug. 🙂

Automation doesn’t work well for what I’m attempting to do here. Namely, I want Photoshop to be open and basically running "as usual", then employ an action to perform a series of steps on an image that are sufficiently strenuous as to put the system to task in getting some idea of how well PS performs on that system. In the case of this new action I’m building, rather than have it applied to an existing image I am instead using the action to also generate the image. I’ll be providing this action to fellow Photoshop users to run and provide data to me so I can collect it together in a format similar to what I’ve done previously at <http://jazzdiver.com/photoshop/pc_test.htm>. Actually, I’ve got the action complete (no patterns created or deleted :)) and available at <http://jazzdiver.com/photoshop/PSBench.atn> but haven’t announced it outside of this comment, as I’m still trying to put together a new web page as well as identify the data I want to collect.

Thanks for all the help…and insight,

Daryl
Y
YrbkMgr
Feb 15, 2004
Daryl,

I’m surprised that you’d have to reset the options to get the pattern to define properly so that the action works as intended.

I haven’t studied the detail. I suspect this: patterns are stored in the Patterns.PSP which is updated/saved when the user closes photoshop. The option selections, as in the Options Bar are saved in the Adobe Photoshop 7.0 Prefs.psp.

So it is entirely possible to have a pattern selected in the options bar, or as an adjustment layer that will be stored in the Prefs.psp, yet not the Patterns.psp.

Consider this. When you use the Paint Bucket tool to perform a fill operation, say, using a pattern, that option is stored with the other paint bucked options that you last selected, in the Prefs.psp. If you delete the pattern from the presets manager, yet do not change the pattern in the Paint Bucket options, the Patterns.psp is updated when you close photoshop so that the pattern will be gone, yet, the Prefs.psp is updated to include the pattern since it was a part of the Paint Bucket Options.

Make sense?
NB
Norbert_Bissinger
Feb 15, 2004
Oh my G

After reopening PS it does not work anymore!

Well again It seems to work. Check it out.
Y
YrbkMgr
Feb 15, 2004
It will work upon reopening, IF you double click on the fill step of the action, and then explicitly select the CMYK Blocks pattern.

It’s as you said Norbert, and you’re the one who clued me in: until it’s explicitly selected from the pattern palette, it refers to a pattern that is stored in the Options, not necessarily the Pattern.PSP.
DP
Daryl_Pritchard
Feb 15, 2004
Yes, it makes sense Tony….as I’ve said before, one learns something new every day in this forum.

Daryl
NB
Norbert_Bissinger
Feb 16, 2004
I only used patterns a few times a year or two ago, have no need for them. Was curious about this issue coming from Daryl whom I know and respect among others as very well versed in PS and general computing.

I had to learn actions very well because I am using PS as a special event program and can do better with PS then with these $3.000 programs to the point I sold my PC Pro.
DP
Daryl_Pritchard
Feb 16, 2004
Norbert,

Thanks for the compliments. As this post is pretty much evidence of, there are some things in PS I understand quite well, but many more than I’ve still got a lot to learn about. As with yourself, I’ve not often done any editing where I’ve used patterns. For the most part, my edits are all rather rudimentary. A lot of what I share in the forum comes really from exploring the questions on my own at the time they are posed, or just by absorbing what I’ve read over the years.

Regards,

Daryl

Related Discussion Topics

Nice and short text about related topics in discussion sections