replace color and key skeleton scripts

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

Moderators: Víctor Paredes, Belgarath, slowtiger

janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

replace color and key skeleton scripts

Post by janimatic »

Hey all,

here are my 2 very first moho scripts :

replace color :
workaround for ai color import problems but cool tool anyway... I am waiting for named styles in the API! Todo : search/replace in the whole project

key skeleton
key the complete skeleton hierarchy. Very usefull for scene planing in step mode!

take them all here :
http://animatic.no-ip.com/pub/dev/moho/js_tool.zip

or browse the files here :
http://animatic.no-ip.com/pub/dev/moho/

Requests and suggestiosn are welcome
Best regards!
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

Real dumb question from me, who is new to Moho and scripts:

In which file in Moho does one put these scripts?

Thanks!
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

Hey toooooon!

put those scripts (together with the icons) in
[moho instal dir]/scripts/tool

They will appear in the tools window

you can create your own

you can also add your scripts in the script menu
in that case put those scripts in
[moho instal dir]/scripts/menu/[whatever]

They are really not complex, but anyway it seems like people in here are very nice and ready to help , maybe even write scripts on demand if that's really usefull

here is the API doc if you are interested :
http://www.lostmarble.com/moho/extras/s ... ipting.zip
waterdown
Posts: 10
Joined: Thu Oct 07, 2004 12:58 am

cool new scripts need help

Post by waterdown »

I have installed your new scripts. They look cool but I am not sure how to use them. i tried to change colors but nothing happened. Thank you for making these scripts. brian
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

hey Brian,

i should add some help so here we go :

to instal the scripts:
-place the scripts and icons in you tool folder
-relaunch Moho

Key skeleton :
-select a bone layer
-select the tool
-clic anywhere in the workspace, it will key the whole skeleton hierarchy (pos/scale/rot)

Replace color :
-select a vector layer
-clic on a color to replace
-ALT-clic on the new color replacing the old one (and/or use the "new color" color swatch to adjust it)
-clic on "Replace all" it will replace every instance of the old color by the new color in one go
NOTE:
Replace color is actually limited to one vector layer (the selected one)
I will update it later to act on the whole project

I hope it's easy enough!!
enjoy and please tell me if i can help

regards

Julien
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

Greetings!

I tried out your scripts.

The "Key Skeleton"

I was trying to figure out how I could use it - when would I want to do that?
In Moho when I move the bone Moho already automatically adds a keyframe or I could just go to the timeline and add a keyframe. Why do I need to add all the extra keyframes that your script creates?

Also I noticed that after the first use of any of the keys in the script, it would always placed 6 keyframes in all the boning layers of the time line. What is the purpose of so many extra keyframes?

I guess I must have been using it wrong.

----------------

The replace color script:
Doesn´t this take more steps to change a color using this script than just use the "Select Shape" tool to change the color?

Side note: I wish the "Select Shape" and all other tools in Moho would allow one to select more than one object or shape at a time.
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

hey toonzzzz

key skeleton :
i need to do animation in step mode (without interpolation).
Anyway it's good to start posing and doing the layout in step mode even if you wan't o use interpolation later.
If you do this and some keys are missing the animation wil be messed up if all channels are not keyframed. This script keys EVERY channel in EVERY bones to allow posing and layout (like in maya and any skeleton based anim package)

Color replace:
u can not replace more than one shape at a time without my script!
How do you fix imported illustrator vectors without this??

i made those for myself cause i need them for production intensive use, noone asked you to use it, i just share it in case you find it usefull
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Toontoonz wrote: when would I want to do that?
Why do I need to add all the extra keyframes that your script creates?
What is the purpose of so many extra keyframes?
One situation when it would be useful is when you block out your animation (if you do pose to pose animation). If you create a new pose based on a previous, later decides you have to make some changes on the first pose and if you then have some unkeyed bones in the second pose that pose will change and you have to redo it. You get more control when you have all poses completely keyed out.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Key Skeleton: also, more fitting to the way I work, sometimes I want portions of the character to "freeze" (or pretty much so) after being put into position for a number of frames. I usually have to add a bunch of keyframes by hand. Sometimes I forget one, and when I play back the amnimation, somethings goes horribly wrong. This helps prevent it.

Haven't played with the other one yet. Cool work, janimatic.

--Brian
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

Regarding the skeleton script I guess I have to work with the scripts more and Moho to see how it should be used. I apparently don´t fully understand the possibilities of using it yet.
---------------
Without using the bone script, If I have a character I am animating and go to frame 12 in the timeline and move a bone on a character, 2 keyframes are automically put in the time line. (I could then go to keyframe 24, 36, 43, etc and do the same.)

If I use the bone script presented here and alt-click or shift-click or cntrl-click SIX (6) keyframes are made in the each time line segment for the bone position. And what if I do them all (alt-click + shift-click + cntrl-click) - what does that do?

I guees I don´t understand what the differece between the 2 keyframes and the 6 keyframes. What is the difference between the way I do it and the way the bone script does it? Running back the timeline with and without the use of the script I see the same thing. I am obviously missing something here.
When I adjust the character in a new time frame why doesn´t Moho automatically do what this script does (add the extra keyframes)?

Thanks for clearing this up for me.
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

janimatic wrote:hey toonzzzz

Color replace:
u can not replace more than one shape at a time without my script!
How do you fix imported illustrator vectors without this??
After experimenting with it, now I see what this script does. :idea:
On every part/shape of the drawing that is on the same layer and has the exact same color it can change all these colors and shapes at once.

So if the skin color is red and the different shapes of the body parts - face, hands, arms, etc (and any other parts) that are the same color that changing one will change them all.

So instead of having to select and re-color each shape individually this does them all at once. Similar to what is described in Tutorial 2.7 "Styles".
But the the different parts all have to be on the same layer, correct?

Yes, I can see this can come in handy. Thanks for writing the script! :D

(Sorry for it being difficult for me to understand.)
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

oops i am sorry

i didn't implement the ctrl / atl shift modes
they just do the same as a simple clic actually key all channels)
I can do it quickly if u find it really usefull but i just want to keyframe everything

What the script does is simple : it just keys every channel of every bones (not just one like you say)
You will understand it if u select all your keyframes and change it to STEP mode to remove interpolation. you need keyframes everywhere in that case (otherwise u just loose unkeyed channels/bones)
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

jabimatic - Just add mouseEvent to the front of your key tests (e.g. mouseEvent.shiftKey instead of just shiftKey and your options will work. If the scripting reference was a little clearer, you could also easily automatically set the keyframe interpolation you want (in your case step but throwing in a little menu list of the types would be a cool thing.

Toontoonz - First, when you say two keyframes, it's actually only one. One of the lines (the upper, with the blue line) is meant to show you if there are any keyframes for any bone in the layer. The other (with the red line) is meant to show you if there are keyframes for the bone that is currently selected.

The difference between 2 and 6 (actually 1 and 3 but that starts to get confusing so you needent worry about it too much) is that when you see 2, it refers only to the specific animation channel you've made a change on, in this case most likely the Rotation channel. The other 4 are for the Bone Scale and Translation channels, which you may not be using much.

--Brian
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

thanks for suggestions 7feet!
i will add this asap!
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

update

Post by janimatic »

i just updated the key skeleton script :

- CTRL / SHIFT / ALT are now handled correctly to limit keyframed channels
- a step mode check box on top (on by default) sets automatically your keyframes to step mode (no interpolation)

please just replace this file in you tool folder :
http://animatic.no-ip.com/pub/dev/moho/ ... eleton.lua

thank you all for the feedbacks
enjoy!
Post Reply