Brawlbox Modset 4.1 is here! Draggable bones, among other things

Started by ??_?, November 13, 2010, 04:52:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

download brawlbox modset 4.1 (Fixed Bugs)
Rydia's tutorial

Quote from: beroChange Log of Modset4.1

   * Added a button "Paste only Trans" to Animation editor
   * PAT0 editing function(test)
   * Drag-And-Drop Animating(THANKS,KRYAL!)

Draggable Bones:
Quote from: Kryal;11604757Okay, it's done (for the most part)
Lots of changes yes, but our focus is on:

Maths / Matrix / Vector3
GLPanel / GLContext / ModelEditControl

All the work takes place in ModelEditControl:

Take note of the PostRender event, which renders the rotation orb when a bone node is selected.

  • At the very end of PostRender, ghost nodes are drawn into the z-buffer for every bone. The z-buffer is cleared prior.
  • New display list objects are employed through GLContext.GetSphereList / GetRingList / GetCircleList. These all contain primitives with a radius of 1. Rendering to the desired radius is simply a matter of calling glScale with the desired radius.
Take note of the MouseDown event, which handles bone node targeting.

  • First, the currently-selected bone is tested against the mouse point.
  • Take note of how the 'radius' variable is calculated, scaling the orbRadius constant to the camera distance.
  • The GLPanel.ProjectCameraSphere method is called for the current bone. This either intersects the bone sphere or its camera-facing plane using a ray from the mouse point.
  • This point's distance is then compared to the bone node, and tested against the radius and the orbit ring.
  • If the point falls within radius: convert the point to local-space, get its angles, and test for axis snapping.
  • If the point falls within the orbit ring, enable orbit snapping.
  • If the point falls within neither, transfer to hit-detection. (We will try selecting a new node)
  • After snapping flags have been set, call GetOrbPoint. This retrieves the world-point that intersects our snapping plane, using a ray from the mouse point. Take note of how the normals for the planes are calculated. The point is then clamped to a distance of 'radius' from the node center.
  • Convert this point to local-space and store it. This will be our origin point.
  • Store the bone's old rotation values. These will be used for escape-key cancelling.
Part 2: If no bone is selected use hit-detection

  • Get depth of mouse point. If < 1 we found something.
  • UnProject the point to world coordinates.
  • Compare all bones to this point, finding one whose distance matches the node radius. (Not the rotation orb)
The MouseMove event is where the rotations are updated:

  • Call GetOrbPoint to retrieve the snapped world-point.
  • Convert the point to local-space. We will compare this to our origin point.
  • Create a matrix by multiplying the bone's transformation to an Axis/Angle matrix.
  • The Axis/Angle matrix is created by Matrix.AxisAngleMatrix, just supply the origin point and the new point.
  • With this new matrix, derive the resulting angles by calling GetAngles.
  • Subtract the bone's frame angles from the resulting angles to get the difference. Notice how GetAngles is used twice.
  • Truncate the difference by wrapping the degrees from >180 and <-180. This allows the angles to continually increase/decrease.
  • Apply the new angles by adding the difference to the bone's frame state. (I let the anim panel handle this so that keyframes are created)
Some things to watch out for:

Bone scaling may affect how these points are converted to local-space.
I ditched the Quaternion method because conversion is a nightmare. However, converting a matrix to euler angles can be problematic. You may notice that the rotations look fine, but the angles are odd. This particularly happens to the y-angle.
http://www.smashboards.com/showthread.php?t=277835&&page=25

:happy:

I never knew much about this, but will it make bone editing simpler?


Quote from: LordNOaH on November 13, 2010, 05:10:34 PM
Quote from: Hax on November 13, 2010, 05:06:49 PM
I never knew much about this, but will it make bone editing simpler?
yes, any type of animation editing, model imports, etc will be much less tedious and far easier.
:af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:

Quote from: Soverign on November 13, 2010, 05:19:27 PM
Quote from: LordNOaH on November 13, 2010, 05:10:34 PM
Quote from: Hax on November 13, 2010, 05:06:49 PM
I never knew much about this, but will it make bone editing simpler?
yes, any type of animation editing, model imports, etc will be much less tedious and far easier.
:af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:  :af2:
THis...is win...I can't wait!
:af: :af: :af: :af: :af2: :af2: :af2: :af2: :happy: :happy: :happy: :happy: :yay: :yay: :yay:
Ok enough smiles.
I haven't read anything but animating is easier and i'll read it soon though. But will rotation with the numbers still be viable? I know theres a preview release...hmm....someone should make a video o.o

Draggable bones! YESZ  :falcon:

Draggable bones is so much win!!! But there's no undo button :(


Random advice time.

If you are using the newest modset and you find the angle value to be really odd(as in too far away from 0), You can fix it. Look at the value and if it's more than 360 or -360 Add or subtract 360 as long as it will get you closer to zero and fix transitions..... unless the previous keyframe has a ridiculously high value.

For example: If I get -400, I add 360 and will end up with -40. The bone's rotation won't appear to be changed, and the transition is much smoother.


Quote from: LordNOaH on November 13, 2010, 05:10:34 PM
Quote from: Hax on November 13, 2010, 05:06:49 PM
I never knew much about this, but will it make bone editing simpler?
yes, any type of animation editing, model imports, etc will be much less tedious and far easier.
Prepare for higher quality bone edits. >:D


WELL, I played around with it for a few minutes. click a line wrapped around the circumference the sphere to change its rotation; Red=X axis, Green=Y axis, and blue= Z axis. you can also simply click the sphere and control all three at once, but I found this difficult to control. I have no idea what the yellow circle around the sphere is for, it also changes all rotation values, but its limited and also hard to control.

I assumed that this would also be able to control the translation values, but it appears that it doesn't. I'm a little disappointed at this, as this is what I was excited for. It would make more sense if when the bone was selected, it could be dragged along the x and y axises, and perhaps a button held such as ctrl or shift would allow the z axis to be changed. and maybe another toggle button to change from rotation to translation.

I might play around with this myself to add this, but my C# is rotten.

So I got around to testing this and it was pretty cool :D. But totally confusing :(

I've never actually figured out which axis is which in the 0.63v version of animating. Very interesting. Can't wait for an official release.

Quote from: Date Masamune on November 13, 2010, 07:43:24 PM
Yay! Imports from other games, prepare to flood Brawl. >:D

^This^

EDIT:When previewing imported models from other games, only the first bone will show up and the models is unmovable :( 

The model import I'm working on shows all the bones... and this update reminds me a lot of 3ds max :O

I think the problem with imports is added bones. Open a model without any bones added and it should work

Yup. Also BACK UP YOUR MOTION ETC AND YOUR ANIMATION.

If you knew what happened to me and Lyn, you would know why.

THankfully, I managed to recover the animation.