Overwrite Styles

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Slyanim
Posts: 23
Joined: Wed Jan 25, 2017 11:42 pm

Overwrite Styles

Post by Slyanim »

Hi Everybody,

(I don't know this is the right discussion tag)

Is there any solution, how to overwrite styles in moho? For example, i have a character with a fill colour ("green" colour), named STYLE_A. I have a character in an other file, which has a style with the same name (STYLE_A), and its colour is "blue". When i import my "green" character to the file of the "blue" one, i want to overwrite the "blue" to "green". Any ideas?

-- FOR PRO SCRIPTERS!

If someone can write some script, to solve this problem, i can pay for him. :mrgreen:

Thanks for the answers in advance!
amanandink
Posts: 252
Joined: Wed Feb 13, 2008 10:28 pm
Location: Kilkenny, Ireland
Contact:

Re: Overwrite Styles

Post by amanandink »

Hi Slyanim
my understanding of styles is that they are assigned a unique id by the programme on creation and it is this hidden idea that is used for tracking and overwriting the style inside different scenes. The name, in the case you describe doesn't matter.
Its the same system for things like layers, you can have as many layers named "layer 1" as you want, its the id that's assigned to the layer by the programme that is important.

its is possible to create a file script hat will change a style colour from blue to green, but unfortunately I'm not a scripter, how we have dealth with such things in the past is to just manually change them in each scene. but then you can reference your characters and styles and only have to change the colour of the master rig and the referenced models will change.
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Overwrite Styles

Post by Greenlaw »

Styles are not identified by their names, which is why they can conflict even when you change the Style names and apply different style properties in them. This is because Styles are actually identified by an ID number that's kept invisible to the user. To make a unique copy of an existing Style, you need to change the ID number. Unfortunately, there isn't a direct way to do this inside Moho. I've asked for a change ID button or an edible ID number box but it hasn't happened yet. But I know they're looking into updating how the Style window works for a future version of Moho so maybe we'll see this capability eventually.

That said, it's possible to change the Style ID in the current Moho when you import an item that has a Style applied. When you select an item from a project from the Import window, and that item has a custom Style applied in it, you will see a option called 'Unlink Shared Styles' in the lower right corner. This option will assign new ID numbers to the Styles so they can have unique properties even when other items exist in the scene with the 'same' styles applied.

For example, there's a sequence in Boss Baby: Back In Business where I had to create a lot of unique cats. I really only created one rigged cat character with one set of Styles applied, and then I saved multiple versions of the cat project and changed the colors in each cat's Styles. To make them more easily identifiable to me, I renamed the custom Styles in each cat project. (i.e., catOrange, catBlack, catGray, etc.,) Now, while it might seem intuitive that changing the Style names for each version of cat will make the Styles unique, Moho doesn't see it that way. If I import each cat into a new project without using 'Unlink Shared Styles', they will all come in with the same style property, even if each cat has a unique style name. However, if I import each cat with the 'Unlink' option enabled, the unique Style properties will be preserved. Note that if I hadn't changed the style names, there will be multiple 'copies' of the Style, which could get confusing. This is why it's helpful to rename the duplicate styles in each cat's 'master' scene.

I hope that explanation isn't too confusing. If it is, try experimenting with some simple artwork with custom Styles applied. This workflow should make sense after you've done this a few times.
Post Reply