Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

replace layers/groups with a certain name by another?

Explorer ,
Nov 15, 2018 Nov 15, 2018

Is it possible to tell illustrator to replace a layer/group with a certain name by a selected layer/group ?

For instance: replace every group named "Arms" (under my selection) with the group name "Arms" from group "Steve".

I'm asking this because I want to make a crowd of people dance, and so I started to create a character named "Steve" in 14 different poses (I would animate using after effects later on).

Now many body parts are identical from a pose to another, for instance the body is the same in pose 1 through 7.

In this case all chars will be doing the same moves, meaning the dance poses are the same from a character to another.

Now when created my second character Suzan in the first pose, and I would like to avoid copy-pasting the body to pose 2 to 7 (because this will repeat not only for the body, but for other parts as well, and not only for Suzan, but also for any number of people in my crowd, so that copy pasting will potentially be repeated a lot).

So, since each pose is on its own group in my case, is there a way to tell Illustrator to replace all groups named "Arms" in my current selection with the group named Arms chosen before hand ?

Or, alternately, is there some kind of global objects (same as for global colors, but with objects)?

TOPICS
Scripting
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Nov 21, 2018 Nov 21, 2018

I believe this can be accomplished using graphic styles, specifically the Transform effects. You would have to take your sample character and use the transform effects on each of its shapes to move them according to the current dance position. Then you would capture them as graphic styles and name them to ensure a unique identifier that can help with knowing what's what. Additionally you may need to assign the proper notes to each shape of every character, because, the way this would work is by

...
Translate
Adobe
Adobe Employee ,
Nov 20, 2018 Nov 20, 2018

Hi there,

There is no direct way of doing that, however, a script might help you with that, hence moving the discussion to Illustrator Scripting

Regards,

Srishti

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2018 Nov 20, 2018

can you post some screen shots showing what you need?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 21, 2018 Nov 21, 2018

I believe this can be accomplished using graphic styles, specifically the Transform effects. You would have to take your sample character and use the transform effects on each of its shapes to move them according to the current dance position. Then you would capture them as graphic styles and name them to ensure a unique identifier that can help with knowing what's what. Additionally you may need to assign the proper notes to each shape of every character, because, the way this would work is by using Illustrator's Actions feature and being able to select items via note.

Be aware that in fact not all graphic styles have to be completely unique to their purpose: they can also be used generically when the case is right for generic transformation usage. For example, say you want to rotate the (screen) right arm of a character by 45 degrees, from the left-center anchor point of its bounding box. Maybe in the same configuration another shape needs to have the same exact rotation and you can use the same style to accomplish the same thing on different shapes. While it may be rare that some shapes would have the exact same transformation style in one dance configuration, surely there would be many repetitions across every move. Since all of these graphic styles are required to be present in the document when the action is played, it pays to have as few as possible.

You will need to construct as many actions as there are dance move configurations and they will each have to be composed of many duplicate events concerning selection of every uniquely-noted item (not names in the Layers panel, but notes in Attributes panel) and applying the appropriate graphic style. Then once you are done constructing one such action that selects all shapes and applies the graphic style that's needed, you will need to create a way for there to be a new editable character in the document when you run the action. Either you have a folder of individual files which each contain a character and you can run a batch of actions through it, or just a single one on an active document, or you may have some way to isolate characters within a single file if you are using one file with multiple characters in it.

Already though, this solution may seem like it would be really tedious and painfully slow. For one, you have to not only make a new graphic style for every shape's every different configuration, you'd have to make an action for every configuration and that action would have to be made of individual actions that apply one style to one shape (or group, rather). But fear not, because there's a secret weapon that you can use, see next paragraph!

For ultimate control, you can also add the use of this script-based technique which also uses variable data. This would be an unorthodox and exciting use for variable data which would truly differentiate Illustrator's variable data abilities from that of InDesign. With it you could accomplish things such as randomized sets of characters with synchronized or randomized dance moves - you'd have to shuffle the data to suit yourself inside of a spreadsheet program, but that's how you can turn a standard piece of art into an extrapolated & uniquely styled variations.

With this technique called "The Recolor workflow", you can completely avoid the bulk of the action step altogether and take care of that logic within a spreadsheet - much faster and much more editable. There are a couple auxiliary articles, one of which goes over an automatic helper script for this workflow that makes it even faster by providing a spreadsheet format to help with the setup.

The subset of the Recolor script's features you will want to use is the ability to apply a graphic style to a group. With this capability you can now avoid creating an Action for this purpose but rather specify intuitively in a grid format the style you want to be applied to which group.

See the 10 minutes after this link marker in this YouTube video which will help demonstrate this method.

In addition to being able to apply a new style to art which overrides any previous appearance, you can also use a style cumulatively, meaning you can add the same style, or different styles to art as an addition which does not nullify any pre-existing appearance on the art. To inspire any ideas, for example you can add a rotate effect by 10 degrees multiple times via the course of a batch action so that the first item is rotated 10 degrees and the last item out of 10 items is rotated by 100 degrees.

When using variable data, you are able to use placed files as a variable, so you may even have one file which contains one 'generic' character composed of placed & transform-styled rectangles containing individual body parts and you can swap out both the body parts as well as their styled transformations to export a multitude of your posed characters from one single mega-template (& many accompanying body-part files).

To add to that, when using variable data, the workflow uses batch processing using datasets as the source instead of a folder of files. This means that you can use a single template with the swappable body-part placed items, or different layers with characters or different artboards with characters and use various Illustrator Action techniques to create all your varying results from the one file.

If you want to make use of the Recolor workflow, I would be interested in seeing if you'd like to share some details about it and allow me to feature it in a LinkedIn article about variable data usage.

Speedometer-cycling.gif

Here's an example of a cumulative transform effect used with the Recolor script workflow, but in your case I think they will be all overriding transforms for this project.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 21, 2018 Nov 21, 2018

Thank you all for your answers, especially Silly-V (pfeeew, that was a long one), but the others as well.

It turns out in the mean time I completed the characters manually (bummer), but if the case either happens to me again, I would try to implement Silly-V's suggestions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 24, 2018 Nov 24, 2018

Actually, don't meet me there, beat me there! If you see your project needing further work of the same kind, here is my offer: contact me and I will personally (if all works out) work on this template for you in order to get the variable data/scripting set up just right for you, hassle-free! My take would be to create a write-up about it in form of a LinkedIn article which would be a great show-case for an uncommon usage for Ai's variables.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2018 Nov 24, 2018

Well thanks for the offer. As for now, I'm done with those characters, I will post a link to the video here when it's finished, just for the follow-up. But if you want the source files, just email me I will send them to you (for free), here is what it looks like:

overview:

chars-overview.png

close-up:

Screen Shot 2018-11-25 at 08.05.19.png

Note: I did this style of characters by watching this tutorial: How To Draw A Face, 10 Flat Design Characters in 10 Minutes, Speed Drawing in Adobe Illustrator - Yo...

(I was unable to create this style by myself).

So back to the discussion, if you want to save the time of creating the characters (should you choose this specific dance thing example for your project), I'll actually be glad if you used those characters, because then you could maybe mention a link to the youtube video. Or if you want to use them without mentioning the link that's fine too, the work is done already so I can just give them to you and then you use them as you want, no problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 25, 2018 Nov 25, 2018

Very nice, I may contact you in the new year to take up this fun exercise and see if my answer can truly test the proof of concept. From the screenshot it appears to be possible, with some exceptions concerning the starfish alien as well as the 'baby' characters who are different from the majority of the 'tall' characters. I'm interested in exploring this, but will have to take care of some very urgent projects first. Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 25, 2018 Nov 25, 2018

Any time. Good luck with all your projects.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 09, 2019 Feb 09, 2019
LATEST

Well, for the follow-up, here is the final project:

Wave Birth - YouTube

(characters start dancing at 3:22)

I ended up doing all the renaming/grouping manually.

Although I like the concept of scripting, I tried the illustrator js api, but my layers were too disorganized and I couldn't find a pattern that would apply to all my characters.

Had I named and grouped my layers correctly in the first place, I would have saved a huge amount of time.

So, the lesson I got from this is: pre-planning is where the real time saving is done.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines