Anyone know why the mesh won't move with this code?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Anyone know why the mesh won't move with this code?

Post by heyvern »

When I use this:

slv2.fPos = vec2

The bone in question (slv2) moves on screen just as it should, but the mesh bound to that bone doesn't move. vec2 is a position derived from another bone position and is added to this bone's (slv2) position.

If I add a key frame for slv2 then it does update the mesh properly.

I am trying to eliminate key frames where they aren't needed. I just want the slave bone to move without generating a key frame, like a constraint. I can't use a constraint because the target bone isn't really moving it is translated based on another bones rotation. This "target" bone does have a key frame.

Everything works as it should, the problem is that the mesh doesn't update. Is there a way to force the mesh to update?

-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Dagnabbit!!!!!!

Code: Select all

moho:Skeleton():UpdateBoneMatrix() 
Good grief. Everytime. Every single time this happens. I post a question and 5 seconds later (after hours of fiddling and searching) I find the simple answer.

:)

-vern
Post Reply