Bone morph dials script
Moderators: Víctor Paredes, Belgarath, slowtiger
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
I managed to do it... easy to do, hard to explain - here's a screencast
http://youtu.be/4i5_7Bgwjpk
The thing to note is that the 2 bone is a child of the 1 bone, and going to the main time line makes the MD affect the shape in its original state, so you need to rotate the bone at frame 1 so that it puts the influence back to 0 - in this case, 9 o'clock.
the odd thing was that when recording the screen cast i needed to move the bone -45degrees, but when I tried it before recording i had to rotate the bone +135degrees - i guess i must have created the bones differently, so just rotate it until its back to 0, and if it's not at 9 o'clock, rotate the parent bone till the MD bone is facing west on frame 1.
http://youtu.be/4i5_7Bgwjpk
The thing to note is that the 2 bone is a child of the 1 bone, and going to the main time line makes the MD affect the shape in its original state, so you need to rotate the bone at frame 1 so that it puts the influence back to 0 - in this case, 9 o'clock.
the odd thing was that when recording the screen cast i needed to move the bone -45degrees, but when I tried it before recording i had to rotate the bone +135degrees - i guess i must have created the bones differently, so just rotate it until its back to 0, and if it's not at 9 o'clock, rotate the parent bone till the MD bone is facing west on frame 1.
The short answer is no, but Funk and Jonbo have offered some good suggestions that should work.
Another thing you could try is making the morph dial a child of another unnamed bone that you rotate counter-clockwise by 90 degrees on frame 1.
If you wanted to try changing the script, the relevant code is on line 154 of rt_bake_morph_dials.lua:
To make 9:00 the neutral position, it should just be a matter of adding math.pi instead of math.pi/2, ie:
Another thing you could try is making the morph dial a child of another unnamed bone that you rotate counter-clockwise by 90 degrees on frame 1.
If you wanted to try changing the script, the relevant code is on line 154 of rt_bake_morph_dials.lua:
Code: Select all
-- Up is 0, right is 1.0, clockwise is positive
weights[name] = (-bone.fAnimAngle:GetValue(frame)+math.pi/2) / (math.pi/2)
Code: Select all
-- Left is 0, up is 1.0, clockwise is positive
weights[name] = (-bone.fAnimAngle:GetValue(frame)+math.pi) / (math.pi/2)
Last edited by Rudiger on Tue Feb 28, 2012 3:13 am, edited 1 time in total.
-
- Posts: 306
- Joined: Thu May 13, 2010 2:01 pm
Where did you even find that a bone's angle is in 2*pi counterclockwise? Trial and error?Rudiger wrote:Code: Select all
-- Up is 0, right is 1.0, clockwise is positive weights[name] = (-bone.fAnimAngle:GetValue(frame)+math.pi/2) / (math.pi/2)
This scripting for Moho needs a manual!
Well, there is an html manual, but it has been out of date since AS6. I think it comes with the AS installation now, in the "Extra Files" folder.Breinmeester wrote:Where did you even find that a bone's angle is in 2*pi counterclockwise? Trial and error?Rudiger wrote:Code: Select all
-- Up is 0, right is 1.0, clockwise is positive weights[name] = (-bone.fAnimAngle:GetValue(frame)+math.pi/2) / (math.pi/2)
This scripting for Moho needs a manual!
Other than that, I use lots of print statements to do things like printing out the angle while I rotate the morph dials.
Took me a long time to understand everything but think I have it working.
Only thing is it doesn't seem to do fill changes, which blend morphs can, however, Blendmorphs are too slow anyways compared to this so no big whoop.
Though it does seem nerve wracking riggging a character this complex - I'm afraid I'll mess something up with the bones etc.
So how it it when it's actually NESTED a few levels deep in a skeleton - all good?
Also keep getting errors for both buttons - says attempting to refer to a nil on line 117 on both scripts.
Only thing is it doesn't seem to do fill changes, which blend morphs can, however, Blendmorphs are too slow anyways compared to this so no big whoop.
Though it does seem nerve wracking riggging a character this complex - I'm afraid I'll mess something up with the bones etc.
So how it it when it's actually NESTED a few levels deep in a skeleton - all good?
Also keep getting errors for both buttons - says attempting to refer to a nil on line 117 on both scripts.
Awhile ago someone (myself included) had written that Anime using Morph Dials would crash as soon as you change a bone's name and deselect. I'm not sure anymore what the solutions to that were (mostly because I'm too lazy to search thru the entire thread again) but I've noticed that, this crash seems to only happen when I have a control bone controlling other MD bones (for example sad;happy;etc) and I were to erase or change the name of my "sad" MD bone or erase the bone entirely. A way around this would just be to change the name of the bone or erase it from the control bone's "list," then you should be safe.
Hammer down on an empty chamber