Jump to content

Trixt0r

Members
  • Posts

    118
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Trixt0r

  1. Good news dudes! The generic spriter plugin for java has evolved. I added the following features: * Play animations in forward and backward ("wow" =D). * Animations are running now on android with libgdx (have a look at GdxSpriter.java, basically you have to use GdxSpriter.getSpriter instead of Spriter.getSpriter). * You can change the interpolation techniques between two keyframes by inheriting from SpriterPlayer (have a look at the protected methods interpolate and interpolateAngle). The next things which I want to add are: * sprite hotswapping. * quadratic, cubic, etc. interpolation. See ya!
  2. Hey lucid! These are very nice news. Are there any changes in the file format?
  3. I know that it doesn't work on Android. You have to write your own asset loader for that and let libGDX do the rest with the AssetManager. If I have time, I try to write one.
  4. Hey dudes from Brashmonkey! :) Since you implemented inverse kinematics in the editor itself, could you tell us how you implemented that feature? I had the idea to add inverse kinematics in the generic java importer if the implementation is not that hard. Maybe you could post some pseudo code or at least a page where is a good tutorial about this topic. I would really appreciate that. See ya.
  5. Hey hopik, I already implemented bone animation in Discobeard's implementation. See Generic Java Importer, you can pull from the integration branch. The whole stuff runs already in LibGDX, but the implementation is not bug free. Greets.
  6. Will this change the file format in any way? I don't hope so.
  7. I have ICQ, where I am most of the time online (568 399 745). If ICQ is not ok, let me know.
  8. I think this is a plugin specific issue. I added e.g. such a feature to the Generic Java Importer. But if you want some more complex transitions (for example from boned animation to non-boned animation), then Spriter should definitely have this feature. -Trixt0r
  9. I hope, I fixed now the vanish bug. No, I mean you could commit your loader to the libGDX Spriter folder if Discobeard has added you as a collaborator. Please keep testing the SpriterPlayer class. My implementation is still buggy.
  10. Hey Darkkheim! Yes it would be cool if you could create an asset loader for LibGDX, because now you can not run all the stuff on android. Maybe Discobeard could add you as a collaborator, too, so that you can push the loader on github. I added some new features: - You can now manipulate bones at runtime, means you can rotate and scale them. I would also add this feature for objects, but since objects can not be named in Spriter, this feature makes not much sense. But this could be a feature for the future ;) . - You can have smooth transitions between two animations. This feature works right now, but there are still some bugs, which I could not figure out yet. See ya!
  11. Thanks! I pushed my new stuff on the integration branch. You can check it out now. I added a new libGDX project with a little bit more animated monster. You can walk with the arrow keys and jump with 'A'. Furthermore you can rotate the skeleton by dragging the mouse around the screen. Scaling is also possible. Just have a look at SpriterPlayer.java. I bet there can be made some more fixes, cause I didn't test everything out yet. See ya!
  12. Sounds great! I fixed many things in your implementation. Furthermore I added following features: - Rotate an animation - Scale an animation - Flip an animation I tested everything with LibGDX and it runs quite well on the Desktop. I have to fix some things for the android execution. I'm working now on an user frienldy interface. Maybe I could push my stuff on a new branch, if you add me as a collaborator. Btw: My name is also Trixt0r at github. See ya!
  13. Hey Discobear! I have figured out some bugs in the SpriterAnimation class. So first of all: the interpolation for angles is not the same as for positions, since angles have values between 0 and 359 (or 0 and 2*pi, whatever). I fixed it with two helper methods: private float calculateAngleInterpolation(float a, float b, float timeA, float timeB, long currentTime) { return a + (angleDifference(b, a) * ((currentTime - timeA) / (timeB - timeA))); } private float angleDifference(float a, float b){ return ((((a - b) % 360) + 540) % 360) - 180; } Of course you have to refactor the rotation-values in createDrawInstructions. Furthermore I found this: scale_y = scale_x * tempBones[obj1.getParent()].getScaleY(); //which has to be: scale_y = scale_y * tempBones[obj1.getParent()].getScaleY(); Then the next bug is, that the drawing order is not in the order of the z_index. But I think this is a library specific issue. In libGDX you could just fix that with using scene2d actors and assign the z_index value. Another thing which is not that nice, is that your plugin creates at runtime new DrawInstruction arrays. I bet this will cause lags, especially if you run that stuff on android, because garbage collection is not that fast on current devices. A collection of draw instructions would be an easy solution. See ya!
  14. Nice work Discobeard! A nice feature would be to rotate and scale bones while running the animation. I think it should not be that hard. It is just an extra angle and scale for a bone. Maybe you could specify in the interface whether the children of the bone inherit only the animation specific rotation and scale or also the new one. Two other cool features would be: Set the bone and object data by interpolating between two or more animations with different weights. This could be tricky for interpolating between animations with different lengths. The second one: Create a new animation between two. So you just take the last keyframe of the first animation and the first keyframe of the second one and save them in the new animation. Edit: Never mind. Edit2: The bone animation is quite buggy. Keep up the good work!
  15. Will or has anyone update the libGDX importer for the new scml file format? Or do libGDX users have to use the generic java importer made by Discobeard. See ya.
  16. Nope, there are not so many differences. The main difference is that my skeletons are final. You can't change the hirarchy/structure of the bones. Anyway, I solved my problem. The problem was, that I made some mistakes inverting this method: PointF rotatePoint(float px,float py, float parentAngle,float parentX, float parentY) { float s = sin(toRadians(parentAngle)); float c = cos(toRadians(parentAngle)); float xnew = (px * c) - (py * s); float ynew = (px * s) + (py * c); xnew+=parentX; ynew+=parentY; return PointF(xnew,ynew); } People, who are interested or are going to run in the same problem: Here is, how can calculate the px and py: px = (xnew*c) + (ynew*s); py = (ynew*c) - (xnew*s); px = px/parent_scale_x; py = py/parent_scale_y; Thank you for your attention and your help!
  17. I could do that, but I have very many animations to convert. If I would parent them by hand, it would me cost too much time. Maybe anyone could tell me how spriter calculates the x and y values for a child object or bone if they get another/new parent. Then I could let my converter try to calculate the right values. My idea is the following: Assume I have the absolute point of an object, which I want to parent with a bone, let's call this point oPosition. Then I have a bone, which is going to be the parent of my object at the absolute position pPosition. And this is how I calculate the x and y (newPosition) of the object for spriter: Vec2 getRelPosition(Vec2 oPosition, Vec2 pPosition){ Vec2 temp = pPosition-oPosition; float length = temp.length(); float angle = temp.angle(); return new Vec2(cos(toRadians(angle))*length,sin(toRadians(angle))*length); } But this doesn't work at all. I also tried to inverse the method from here: http://www.brashmonkey.com/forum/viewtopic.php?f=2&t=1400, but didn't work. Btw, if I don't parent the bones and objects, everything works fine for the keyframes. But the interpolation is not the intended one, because the child bones and objects don't move relative to the parents. Thanks for your help.
  18. Hi there, first of all: You did a very very good job. The spriter editor is awesome and I really like your work. I'm new to brashmonkey. I started last week to work a little bit with your scml format. I'm a hobby game programmer, programming a jump and run game with game maker (now trying to move all the game logic to LibGDX) and a few months ago I wrote my own bone tool for my game, and it worked good. But since I saw your Spriter tool I decided to work with it and it's file format. And because I don't want to reanimate my animations, made with my own bone tool, I wrote a little converter, which converts my file format to your scml file format. It works quite good if I don't convert the parenting for bones and sprites. Now the problem: If I let a child bone or a sprite inherit scaling and rotation, Spriter breaks the scaling and rotation of my objects. My question is: Is or will be there a way to define an attribute for an object or bone in the scml file, to do not inherit the scaling and rotation of the parent bone? Because in the a4.1 version the scaling and rotation is inherited automatically if the file is loaded (even for bones). This would make many things easier for me. Greetings from Switzerland :)
×
×
  • Create New...