Hoping to automate changing of colors in a switch layer.
Specifically a hands switch layer. Multiple hands of the wrong color... tedious to change them one by one.
Thought this might do the job: https://mohoscripts.com/script/ae_recolor
But, an error developed... C:\MohoPro\Scripts\Menu\Shapes\ae_recolor.lua.230:attempt to index global 'AE_Utilities' (a nil value)
Mayhaps I am using this improperly as there are no instructions given.
Using Moho 13.5.3 Perhaps this version does not support this lua?
I seem to recall a script by Mike Kelly that did this in the past.
Kindly advise
recolor error
Moderators: Víctor Paredes, Belgarath, slowtiger
-
- Posts: 224
- Joined: Sat Sep 03, 2011 3:34 am
Re: recolor error
This is is an 'afterthought' solution but to do this efficiently, you should create a custom Style for the 'skin' color. This way, when you change the color in the custom Style, every hand drawing will be updated all at once. Literally takes a second this way.
For an existing project using Moho's regular styles, I don't have an quick solution since there's nothing to connect the styles used in each hand drawing. The easiest way I can think of is...
1. Select a shape with the color you want using Select Shape.
2. Click the Copy button in the Style window.
3. Click on each layer and with the Select Shape tool selected, click on the Select All button*. This will select all the shapes.
4. Click the Paste button in the Style window.
5. Repeat for each hand drawing in the switch layer.
Depending on how you've drawn the hands, this shouldn't be too tedious. Naturally, this assumes you aren't using more than one style in each drawing. If you are, then after clicking Select All, you'll need to use the Select Shape button to unselect the shapes not using the 'skin' style settings. (Obviously, you should adjust these steps to suit your design/shapes.)
Actually, the 'smart' thing to do is to use the above steps to apply a proper custom 'skin' Style to the hands so you won't have to go through this again if you decide to change the skin color in the future.
Hope this helps.
*I highlighted this feature because it's fairly new and some users may not know it exists. Previously, multiple shapes in a layer had to be selected using the Select Shape tool by manually 'scribbling' over every shape in the layer. Now that was tedious! With the new way, it takes only a single button click.
For an existing project using Moho's regular styles, I don't have an quick solution since there's nothing to connect the styles used in each hand drawing. The easiest way I can think of is...
1. Select a shape with the color you want using Select Shape.
2. Click the Copy button in the Style window.
3. Click on each layer and with the Select Shape tool selected, click on the Select All button*. This will select all the shapes.
4. Click the Paste button in the Style window.
5. Repeat for each hand drawing in the switch layer.
Depending on how you've drawn the hands, this shouldn't be too tedious. Naturally, this assumes you aren't using more than one style in each drawing. If you are, then after clicking Select All, you'll need to use the Select Shape button to unselect the shapes not using the 'skin' style settings. (Obviously, you should adjust these steps to suit your design/shapes.)
Actually, the 'smart' thing to do is to use the above steps to apply a proper custom 'skin' Style to the hands so you won't have to go through this again if you decide to change the skin color in the future.
Hope this helps.
*I highlighted this feature because it's fairly new and some users may not know it exists. Previously, multiple shapes in a layer had to be selected using the Select Shape tool by manually 'scribbling' over every shape in the layer. Now that was tedious! With the new way, it takes only a single button click.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- hayasidist
- Posts: 3841
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: recolor error
Alexandra has a load of shared routines in a file called AE_Utilities .. which you can get here: https://mohoscripts.com/script/ae_utilitiesrocky53204 wrote: ↑Mon Apr 25, 2022 4:47 pm ...
But, an error developed... C:\MohoPro\Scripts\Menu\Shapes\ae_recolor.lua.230:attempt to index global 'AE_Utilities' (a nil value)
...
it needs to go in the Script\Utility folder of your custom content.
Re: recolor error
Oh, and after all that, I meant to comment on the script and forgot.
@rocky53204, please let me know if you get it to work. If it works, it does sound like an ideal solution in this situation.

@rocky53204, please let me know if you get it to work. If it works, it does sound like an ideal solution in this situation.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
-
- Posts: 224
- Joined: Sat Sep 03, 2011 3:34 am
Re: recolor error
hayasidist nailed it! (Once again!)
"Alexandra has a load of shared routines in a file called AE_Utilities ... which you can get here: https://mohoscripts.com/script/ae_utilities"
Once I loaded all of them the dependencies (like change color) worked!
To use on a switch layer... On frame zero select/highlight the switch layer.
(In the change color popup)
On frame zero check 'Only current frame'
Check 'Change fill' It functions as a from/to color box. Use the dropper to select existing color in first box, second box selects new color.
It will step through all sub layers in a switch layer!
I now use styles but my earlier work did not. To re-use some older items this is/was helpful.
So, thanks to all who replied and a big thanks to the script developer!
"Alexandra has a load of shared routines in a file called AE_Utilities ... which you can get here: https://mohoscripts.com/script/ae_utilities"
Once I loaded all of them the dependencies (like change color) worked!
To use on a switch layer... On frame zero select/highlight the switch layer.
(In the change color popup)
On frame zero check 'Only current frame'
Check 'Change fill' It functions as a from/to color box. Use the dropper to select existing color in first box, second box selects new color.
It will step through all sub layers in a switch layer!
I now use styles but my earlier work did not. To re-use some older items this is/was helpful.
So, thanks to all who replied and a big thanks to the script developer!
Re: recolor error
That's cool! I'll have to give it a try here later. Thanks for following up!rocky53204 wrote: ↑Mon Apr 25, 2022 10:08 pm To use on a switch layer... On frame zero select/highlight the switch layer.
(In the change color popup)
On frame zero check 'Only current frame'
Check 'Change fill' It functions as a from/to color box. Use the dropper to select existing color in first box, second box selects new color.
It will step through all sub layers in a switch layer!

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
-
- Posts: 224
- Joined: Sat Sep 03, 2011 3:34 am
Re: recolor error
A caution on this. If all you want to try is the re-color you only need 2 SCRIPTS/files.
Rather then downloading the many at https://mohoscripts.com/script/ae_utilities
I installed all of them and had far to many buttons I will never use... so lots of deletes!
Look in the upper left corner and you will find the text/script for AE_Utilities 'View Script'
Grab that text file and install it (In scripts/utility folder) and then download https://mohoscripts.com/script/ae_recolor for install using MOHO menu selection.
Rather then downloading the many at https://mohoscripts.com/script/ae_utilities
I installed all of them and had far to many buttons I will never use... so lots of deletes!
Look in the upper left corner and you will find the text/script for AE_Utilities 'View Script'
Grab that text file and install it (In scripts/utility folder) and then download https://mohoscripts.com/script/ae_recolor for install using MOHO menu selection.
- hayasidist
- Posts: 3841
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: recolor error
or just use the "Download Lua file" button to get just the Utilitiesrocky53204 wrote: ↑Tue Apr 26, 2022 2:19 am ...
Look in the upper left corner and you will find the text/script for AE_Utilities 'View Script'
Grab that text file and install it (In scripts/utility folder) ...