Rasheed's scripts

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: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Rasheed,

I've been playing with alternatives regarding using the flip by bone script.

I came up with something I can use for version 1. I still would love to use flipbybones and transrotate together at some point.

I have noticed one thing. If I use your original flipbybones script (the one with out all the features that keys every frame of the layer z-depth) it works perfectly in both directions unlike the newer one. However they both have a problem updating the bone influence on the flipped layer.

When flipbybones controls a mesh layer, it is THAT MESH that stops being effected by bones that are being moved by the transrotate bones.

The bones still move the way they should, so that isn't the problem. The mesh only distorts after the first flip.

It seems that the mesh layer flipping and the transrotate script together is preventing the bone influence to "update" the mesh on that one layer. I don't know a lot about this but I do remember reading through the Moho scripting reference about the bone influence matrix or something like that.

Could it be that on the flipped layer this is not being "refreshed" after the flip?

I can see the bones moving and doing their stuff it just won't effect a flipped mesh.

Other than this mesh problem your original flipbybones script works for me and is an option I could live with (keys on all frames of the flipped layer).

I am going to play around with it and see.

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

Post by Rasheed »

I'm not exactly sure what is happening here, but I've noticed that behavior from the day I wrote the script. I will look into it, and see if I can improve the script to do an immediate refresh of the underlying mesh.

It even may be that I have to write additional keys in the flipping vector layer. At this moment, there are step interpolated keys written into the layer translation channel of the flipping layer, so there is an actual "flip". Of course, it is also possible to do this same flipping with linear interpolation, but you'd need more keys:

Code: Select all

with step interpolation (L=linear, S=step)
          1    1    2
0....5....0....5....0 [frame]
L   S        S        [keys]
+   -        +        [value]

with linear interpolation (L=linear)
          1    1    2
+....5....0....5....0 [frame]
L  LL       LL        [keys]
+  +-       -+        [value]
Of course, I will leave the old step interpolation method intact, so you can still use that in the new script.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

It's the same old problem: I can't change the frame number, so I can only set keys in the current frame. If I would use a tool script, I could probably run through all the frames in the animation to set the keys.

FlipByBones really needs to become a tool script.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

After some testing I think the problem is related to how many bones I have. When I use both scripts in a smaller simple file I can't get the problem to show up. It works fine and the layers flip the way they should.

Now that I have that new "RotateTrans" script some of these issues may be moot. I can do a LOT with that.

-vern
User avatar
Patrick McClintock
Posts: 85
Joined: Fri Mar 09, 2007 5:08 pm
Location: U.S.A.

Flip by bones nd transrotate

Post by Patrick McClintock »

Hi Guys,
I have these downlaods, but they don't show up in my scripts menu. Is there a problem with PC Macs? Is there a place i should put them other than scripts-menu?
Any help would be appreciated.
P.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

These are all layer scripts.

You have to add them to a layer. In the layer properties there is a check box at the bottom of the first tab "Embedded script file".

-vern
User avatar
Patrick McClintock
Posts: 85
Joined: Fri Mar 09, 2007 5:08 pm
Location: U.S.A.

flipbybones

Post by Patrick McClintock »

Thanks Vern, this will really help me get the ball rolilng.
P.
ljupcezitosanski
Posts: 2
Joined: Wed Apr 29, 2009 10:46 am

TransRotate

Post by ljupcezitosanski »

Hello everyone
I am from Macedonia
I prayed that we explain how to effectively use TransRotate in the anime and ashamed of my head I nacrtao okrece and cheerful as to Lika as 3d
hvala hvala hvala Thank you thank you
Post Reply