Possible to copy vector point motion from bone influence?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Rasheed,

Having point keys on every frame was a BONUS for me. I don't really need it.

What I initially needed was only ONE point mesh key frame for each key of the bone layer, just as you did in your "new" version. And also I got that with the original layer scripts.

I do not need keys on every frame. I am not worried in the least about inbetweens not "matching" the bone rotations. I never have that problem when doing switch layers anyway and they use point to point interpolation. If I get my points on one frame I'm happy.

I could easily add a bone key frame ANYWHERE between bone keys in the animation if I needed to and convert that to point motion!!! Bingo!

You see, it doesn't matter to me how many kludgy hoops I have to jump through. I have the ability now to turn ANY BONE MOTION into VECTOR MOTION. It doesn't make any difference how "hard" it is.

From my point of view, you have no idea how cool this is for me. It is just... cool as freaking heck.

For instance, I have larry the Liger. I was trying to produce different expressions. I would have to draw them all. I would have to modify point by point by hand to produce new facial and head distortions for switch layers and lip syncing.

NOW I can use BONES WITH CONSTRAINTS to distort his mouth, his head, squash and stretch very easily and very quickly without messing up the original mesh. If I don't like his snout in that position, just rotate the bone.

I convert that to point motion and I have beautiful wonderful switch layers for use with lip sync and papagayo.

Now of course... others may want more features. I have what I want. ;) I am even happy with the first one! I am as excited about this as being able to control bones on any layer with that little script I created.

I see this script as a way to take vector "snapshots" of bone motion.

<sigh>

I'm getting light headed again... I better stop.

;)

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Working solution using two layer scripts

Post by Rasheed »

Vern, I'm thinking of a menu script that lets you copy the point motion from a vector layer and store it into a a duplicate layer's point motion channel as keys. You can then select a range of frames, or use only those frames which have keys in the bone channels of the layer's parent bone layer. You can also set the name of the duplicate layer, and perhaps do some other useful things I can come up with.

In the meanwhile, here is an improved version of the layer scripts (although I wrote earlier that I wasn't going to fix these). The scripts now sense which layer they are in. Therefore, the name of the original layer and the copied layer should be identical. I also fixed the bug that crashed the program (AS or Moho).

I've put them in a zip archive on my .Mac account:
copy_point_motion_layer_script.zip

The workflow is as follows:
  • stop and restart AS to clear all previous script data from memory
  • load your document
  • go to frame zero and turn off onion skinning
  • copy your bone layer, and remove the bones from the copied bone layer
  • embed the "org layer script.lua" into the original vector layers (inside the original bone layer)
  • embed the "copy layer script.lua" into the copied vector layers (inside the copied bone layer)
  • run the animation
  • to ensure that all keys are stored, select each copied vector layer while the animation is running
  • stop the animation and return to frame zero
  • remove all the embedded scripts from the original and copied vector layers
  • store your AS document
  • stop and restart AS to clear all script data from memory
Store the scripts at a convenient location (e.g. in a subfolder, relative to the document file, called "embed").

Here is some test animation I did (same as before, but now with all layers done at once).

Test2a.swf
(source: Test2a.moho.zip)
heyvern wrote:I'm getting light headed again... I better stop.
Just the oposite here. I didn't get much sleep last night (5 hours or so), so I'm very very tired, my head feels like concrete. I think I skip programming today, and continue tomorrow when my brain has returned to somewhat normal attitude.
Last edited by Rasheed on Wed Dec 06, 2006 10:56 pm, edited 1 time in total.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Don't burn yourself out dude! I've got what I need. It works great for my purposes.

Since I use this primarily for switch layers, I only work with one layer anyway. I would run this "once" to get my keys and go on from there.

Again, thanks a million for this. It is really cool.

I hope to have some of my Larry Liger stuff showing off how I use it pretty soon.

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

heyvern wrote:I only work with one layer anyway
Yeah, but it's an unwritten "law" in programming to make your code as general applicable and useful to as many users as possible.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I agree 100%! ;)

I anticipate great things with this. For the time being it suits my needs perfectly.

-vern
littlethink
Posts: 6
Joined: Fri Sep 11, 2009 4:25 pm

Post by littlethink »

Please help me to run this script in Anime Studio 6.
User avatar
GCharb
Posts: 2276
Joined: Mon Oct 10, 2005 2:31 am
Location: Montreal, Quebec, Canada
Contact:

Post by GCharb »

This thread is 5 years old, Vern has not come on the forum for some time now!
Post Reply