Hi Everyone!
I've been browsing the forum a bit, and it seems that many people would appreciate an ORX animation editor. That's why I've decided to start writing one. I have a functional java-based version already in place. You can just get it from
here.
I've also opened the code entirely, (License:
WTFPL) it lives here:
https://github.com/enobayram/OrxAnimationEditor.git
Here's how it looks:
So, what you can do is:
* Create animations and frames
* Create animation sets (links, etc...)
* Edit various properties of frames graphically
* Edit (and visualize) offsets for each frame
* Visualize and organize animations and links inside an animation set
* View how a frame, animation or a sequence of them look
* Write all of these to a target config file.
* NOTE: It is not possible to parse an .ini file. But you can save the current editor data in a special format and load it later on. The saved editor state can be moved around in the filesystem together with the referenced files and it will keep functioning correctly.
* Help section
I'm very open to criticism/feedback as I don't claim to be an expert java programmer. Please add features and make the GUI more beautiful as you see fit.
I hope this ends up being useful to someone.
Cheers!
Comments
I've testet the output .ini files with orx and they worked
I've also added snipping and a bad slider for changing the snipping size :P AnimEditor with snipping
When I tried to make a .jar out of it I had big trouble with the ImageIcon stuff being static :O I don't have any knowledge about Java and wasn't able to use the icons in the jar, maybe you can help.
AnimEditor.jar
I'm glad it's working, thanks for testing it The snap slider is a very good idea, would you mind if I added it to my distribution? I'm planning to move it to the FrameEditor panel though, it's a bit confusing on the AnimationManager panel.
About the jar issue. There are ways to make image loading possible from jar files, but I never bother. I treat the jar file as I treat the main .exe in a game. So I just distribute my application in its own working directory as a .zip.
Thanks!
Like putting the .jar and the icons folder in one directory?
I've tried that on Ubuntu 12.04 but it didn't work
Even adding it to the .jar archive didn't work.
I've tried but it doesn't work since your ImageIcons are static
Cheers!
Thanks again enobyram, all hail orx
KarloBob, I've updated both the source, and the original binary link to work both from a standalone .jar, and from .class files (since that's the way it's run from an IDE). Now everyone can enjoy a double click!
Cheers, and thanks for all the feedback.
All hail orx and Ubuntu!
I'm looking forward to giving it a try over the week end!
I've finished implementing rudimentary support for animation set editing. So, maybe we can call the editor in its alpha stage. I've updated the git repository, and the binary link.
So, the editor looks like this now:
For example, when you choose "Write to Target" for the state of that screenshot, here's the generated .ini file:
When you do something insensible, f.x, having multiple objects with the same name, or not having set the texture size for a certain frame, writing to the target either results in a null pointer exception, or it simply creates a wrong output (f.x. having a frame and an animation with the same name). But as long as the animation set you're trying to generate makes sense, there's no problem. There are probably also many bugs obviously, but we'll discover them over time.
For those, who might have tried to save the state of the editor with an earlier version; That saved state will not work with the latest version, since I didn't try to stay compatible. Since the editor is now in a functional state, and might be used by someone for useful results, I'll try to keep the loading backward compatible in the future (as much as is reasonable).
I'm looking forward to your feedback!
Cheers.
Do I need anything else than the .jar? Trying to run it (double click) I get an error message telling me the main class orxanimeditor.ui.EditorMainWindow isn't found.
Do I do something wrong (haven't touched Java for about 12 years) or is that a version incompatibility?
Also, is it easy to load a C library from Java? If so, you could benefit of orx's config module and this one will make sure the data is saved with the same format it can read (orxConfig_Load()/orxConfig_Save()) and can also be helpful for your own save state.
No need to use a full version of orx for that, you can compile the library in non-embedded mode (ie. no plugins won't be contained in the library), that's what I'm doing with the orxCrypt and orxFontGen tools too (no display init, etc...).
It might not be worth the hassle though but I thought I'd mention it.
You should be able to simply double click the .jar file. I agree that the .jar isn't working probably due to some JRE version issues. This is an interesting experience for me, since I've never tried to distribute .jar files before. I've tried to compile for JRE 1.6 this time (it was 1.7 before). So, please try again. What OS are you running?
Nice idea! It's actually very easy (read: "not so hard" )to interface C/C++ code to java per se. Especially if you use an interface generator like swig. One problem would be if orx tries to do something to the OpenGL context. Do the config, or the animation modules try to touch the OpenGL context? If not, I could try to use as much from them as possible. Then I'd just need to distribute with the dynamic libraries / shared objects (whatever). Did anyone create orx java bindings? Did anyone successfully run orx inside another widget toolkit (be it C/C++ or else)? I'm asking these, because it would be very interesting, if we could embed orx itself in an opengl widget, and let it do the rendering. Then we could play with FX and everything
I'd really appreciate feedback from anyone that tries to run the .jar file, along with OS and JRE version information if it's not a big trouble.
Cheers!
As for the skeletal animations, what do you guys use to edit them?
For the records, my main OS would be Win7 64b but I also have access to OS X 10.6, an Ubuntu 8.04 32b and a Mint 11 64b.
For orx, there's no external dependency from the core system (ie. everything par of orx library as opposed to the plugins) except for a self contained dlmalloc use and std lib C accesses for maths, memory and file handling. That means there won't be any OpenGL/OpenAL craziness by default unless you asks for it via the plugins.
As for rendering in another window, it's possible with a slight modification of the display plugin (that I should really integrate in the trunk). For an example, you can have look at ainvar's editor, Ocean: https://forum.orx-project.org/discussion/2772
On windows, it's just a matter of setting the windows ID somewhere in config and use it from within the GLFW/display plugin part. Not sure about the other OSes but there is probably a similar way of doing it.
For the new animation system, well, haven't worked on it for months and months, I did the timeline and command modules instead. ^^
Not sure why but I can't motivate myself to work on that... I'll try again end of summer when I get some time.
I'm back from my vacation, and resumed (sort of) real life. I'd like to let you know that I've improved the animation editor (with significant support from KarloBob from the very beginning). The original binary and source links point to the latest version as usual...
Well, the new features since I've last written here are:
- Old rectangle toggle button; the possibility to re-use the previous rectangle in the frame editor view(Thanks to KarloBob)
- The ability to re-arrange animation icons on the animation set viewer (Thanks to KarloBob)
- Now the animation project works even if all the files are moved together. To explain further, now you can do all the editing, and save your editor data to a .oap (orx animation project) file. Now, if you move your image files, the ini file and the oap file together, you can go back to your editing from the new location.
Again, thanks to KarloBob, I've also fixed many bugs. I think, especially with the addition of the last feature, the editor can be truly useful in a real project.
Pending features:
- Ability to pop out/in individual views to their own windows.
- Improvements to the animation viewer, such that you have control over what is displayed. I'm also planning to add the ability to display animation sequences.
Meanwhile I've also managed to run ORX on Android!!! Making the number of platforms I've run ORX on 3/5 That was really fun, but that'll be the subject of another topic
Sorry for the delayed post but I have a lot of things going on in my private life at the time and that doesn't leave me with much computer time!
Looking forward to seeing how the editor is shaping up.
If you have any questions in the meantime, don't hesitate!
NP, I know all too well how having no time feels. I have my own set of forum threads, where I'm planning to reply to your last post, after finding the time to try your respective suggestion
I have uploaded a significantly improved version of the editor. Now it has its own help included, viewable from inside the editor.
I've also fixed various bugs, and improved its usability overall (such as a save prompt before closing). The github repository and the original .jar download link is updated as usual.
Cheers
@Reemon: I'm glad you liked it , could you tell me what OS and (if you're not too lazy to check ) what JRE version you've experienced the help issue? BTW, if you really want to check the help now, the content is simply a set of HTML files contained in the .jar file. You can use any browser to view it.
Cheers!
Cheers
There's now a new version of the editor. I don't want to spam you, but this one's sort of important, because I've made some major changes to the underlying data structures (though there's no visible change to the user). The point is that, the changes are so drastic that I couldn't hope to maintain project file compatibility. This had to be done at one point, so I thought now is probably the best Before you start building some work on top of it, make sure you download the latest version.
I hope to be able to maintain some decent backward-compatibility from now on, since the architecture is much cleaner now.
I'm sure the silent majority of us are interested as well.
BTW, I've watched the Clarion project videos. It's looking really nice! I've also really liked the pixel perfect animations in the older videos. The newer ones are also quite accurate, but not as perfect as the low-res sprites.
That got me thinking how the animation editor could actually help with pixel perfecting the animations. One thing that comes to mind is to be able to slide the animation inside the animation viewer with a configurable velocity, this way, one could very carefully adjust frame delays and pivots to achieve pixel perfect animations.
One could extend this sliding idea with a full system of keyframes, but I'm not sure if this has applications.
What do you think?
Do you know of a good editor that might help with this???
So in my situation, my animation frames vary by width. I keep a value in the config anims for each frame and I use this as the offset to move forward so many pixels.
Would it help you to decide on an approach for the editor if I send you the appropriate config file from the Clarion Project?
It's a good idea to stitch the offset to the frames, that will also make it easier to code in the editor. If you send me the config files, I can make the offset a graphically editable property that also gets written to the .ini file. You can then see the result of the offset immediately in the viewer.
I think the config file would be nice to have, so that we know we're talking about the same thing.
Very exciting
That'd be nice if we could do it inside your editor, for sure.
Could you elaborate a bit more on event synchronization? As it stands, I was planning to attach a custom "Offset" field to each frame, and use it to offset the pivot in the viewer. I would then also export that field to the config file. I'd prefer to do it as "standard orx" as possible though.
Right now you can add custom events to animation frames, in config.
An event also comes with an optional numerical value that will be sent along the event.
I believe that's how sausage did his pixel-perfect synchronization by sending the amount of translation via those events and handling it in the code, isn't it?
Those events can be used for anything, really, from footstep sound/FX synchro to firing bullets, etc.
More info on the current syntax here: http://orx-project.org/wiki/en/orx/config/settings_structure/orxanim
Sausage, do you think this approach will fit your current purposes?
BTW, Iarwain, how would you go about, if you wanted to have an offset in X and Y? It seems that the event receives only a single float.
Sorry, enobayram, I didn't get a chance to get that config to you today.
But in the mean time I did an explaiation of the method in the wiki here:
http://orx-project.org/wiki/en/orx/tutorials/community/sausage/realistic_walk_movement
It should be everything you need. Explains how the eventvalues are stored in the animation frames and how the value is picked up in the event handler and used to update movement.
Really got to hit the hay. But I'll get my other examples to you tomorrow.
@sausage Thanks, this link should be enough for implementation. What does AR1 stand for BTW? Should I export this as the event name?
On a separate note, we've a new version of the editor up now. The changes are purely cosmetic, but I believe you'd like them. Now the Animation Manager supports conventional drag and drop with full visual feedback. You can even press CTRL while dragging to copy instead of move. The drag and drop support is purely within the Animation Manager for now, but I'll soon implement drag and drop for many operations between panels (such as for inserting an animation into an animation set).
There are many more tiny cosmetic changes (such as better visual feedback while editing the name of an object) that I don't even remember , but they make it more pleasant to use the editor.
The next item on the to-do list is to implement offsets then!
I'm back with yet another update, now we've frame offset support in the editor. I've tried to rebuild the config files for your tutorial; you can get the .oap (orx animation project) file (along with the image for convenience) [strike]here:[/strike](Sorry I've uploaded a new version)
Simply unzip this archive somewhere, download the latest editor version, and open the tutorial.oap in the editor. You can then see how the animations look with the offsets.
When you're done editing, you can then write to the target ini, I've already set it to be tutorial.ini. I'd be glad if you tried the resulting ini with the actual engine, and see if it works.
BTW, note that I'm also exporting an offset in y with an event name "AR2".
https://forum.orx-project.org/uploads/legacy/fbfiles/files/Tutorial.zip
There's a new version of the editor up. With this update, drag and drop became quite robust and well-integrated. I've extended the drag and drop support to the animation set editor as well. So, you can now just add animations to an animation set by simply dragging them from the animation manager.
I've also removed the unnecessary "delete animation" and "delete link" buttons in the animation set editor, since now you can just do that by selecting and pressing delete.
The Animation Manager also behaves much more naturally. For instance, when you create a new frame inside an animation, the animation is automatically expanded and the new frame selected. You can then press Enter (new feature) to start editing its name.
In the next update, I'll make the whole export process much more robust, with some diagnostics. So that, what gets written to an .ini file will definitely reflect what you see in the editor. The problem right now, is that you can have duplicate names, and they'll be silently written, over-writing each other.
And in the update after that, I'll make some changes to the Animation Viewer, and you'll love it
Cheers!
Based on the current activity around the Orx Studio, you might have thought that the stand-alone animation editor has stopped development. Well, that's not true. I'm about to make a hefty update to the animation editor. I'm actually planning to call the animation editor at its beta stage with the update, because it will have all the features I thought I would add in the beginning.
There's one thing I'd like to discuss with you before I make this update though. As you know, a recent addition has been the frame offsets. Now they're in the editor, and with the coming update, they become very easy to edit, with 3 different ways to set them.
The problem is how to define the offsets. Currently, when you define an offset for a frame the following is written to the target config file:
So, the event handler can look like:
One could of course do more efficient things like caching (though I don't know it that's really necessary).
How do you feel about this way of handling offsets?
Another point is about whether the offset is "in" or "out", I mean, is the offset applied before or after the frame? I personally thought that the offset of a frame should be applied when the frame is first shown, because it felt more natural. The editor currently assumes that's what you mean by the offset. Though another interpretation could be that the offset is applied at the end.
I have a feeling that the engine supports the latter better. If I'm not mistaken, the event synchronized to a frame is fired at the end of the frame. And further, that if an "immediate" animation link is followed, the event is never fired.
I'm really trying to decide which view is better and how one should implement it. When you actually consider the fact that the collisions are best handled before they take place, each frame defining the transition to the next makes sense. For instance, if the object has the running animation, and if you realize the object is going to collide with a wall in the next frame, you could immediately switch to the bumping animation and cancel the offset.
There's yet another point though: If you define offsets to be after-frame, then the first frame of every animation has to be static (or follows the offset from the previous animation). Take the running-bumping example above. You could want to come up with a sophisticated animation system, such that depending on the speed of collision, you want the object to bounce with different speeds, and for each different speed you have a different animation. In this scenario, simply canceling the frame offset in the event of a collision will not give you the fine control you might want (i.e. finer than simply either current frame offset or zero).
Now I conclude that the most general approach is to be able to define the offset both into and out of a frame. What do you think about the "in" "out" issue? and do you have any implementation suggestions?
nice update. I'm much too tired at the moment for thinking about the in/out issue, but I'm awake enough to ask a question:
why do you separate the offset components instead of having a vector?
Something like this would still work:
Good point That's how it'll be in the update then.
As for the in/out issue, I've decided to stick to the "in" interpretation that's already in the editor. It just feels more natural that a frame carries the information of where the object "is" not where it "will be". As for pre-emptive collision handling, I'll find some other way of conveying the next frame position information on the C/C++ side. When you consider that there could be multiple choices for the next frame, you need a more general approach anyway.
My observation that a frame event is fired after the frame is correct, right? I guess that means I need to handle the first frame offset in the "OnAnim" callback.
I'm looking forward to pushing the update, I hope it'll be a useful tool.
Cheers
"In" definitely feels like the way to go to me too.
As for the events, from memory, they get fired right after we've updated the current frame pointer: we then fire all the events that happened between last update and the current one.
It's supposed to be "simultaneous" from a logical point of view and should be considered as such. Both events and animation update will happen before any other logic or physics update can take place within the same frame.
The animation config section
The code to handle the events:
A section from the program console output:
To me, this looks like KeyEventNameX is fired when KeyDataX is being discarded.
Cheers!
I'll fix that tonight.
This brings us to the major update then! I've pushed the update to both the github repository, and also the .jar link. I would like to announce the animation editor to be in its beta stage! From now on, I'll stop adding features to it for a while (possibly forever considering the Orx Studio initiative), but I'll fix bugs when people spot them. I'm determined to keep the animation project files created from now on to be compatible with all future versions of the editor.
This final version of the editor contains the following new features:
- Config export diagnostics. Name collisions, invalid fields (such as no texture specified for a texture) etc. are detected while exporting to a config file, and reported.
- A more useful animation viewer. Now the viewer has a frame & animation queue to be displayed. The animation view display can also be panned and zoomed
- Tidier frame editor. Now all editing is done via right-clicking with the mouse. The behavior is set by the buttons on the toolbar.
- 2 additional ways of setting the offset of a frame, making pixel perfect animations much easier to specify.
- Specify a root folder (other than the target config file) for the image paths.
- Specify animation links as "immediate"
- Project changes are caught, and while closing a project, if there are any changes, a "save changes?" prompt is shown.
- Extended drag and drop support.
I hope you get a chance to review the current state of the animation editor. It ended up being a very lightweight (pocket size ) tool. I'd love to receive feedback!
Cheers!
I don't think I'll have time to try it over the week end but I'll try sometime next week.
As for orx, if you sync the hg repo on bitbucket, it should be fixed.
Last thing, would it be ok if I cloned your git repo on the official orx bitbucket site? (http://code.orx-project.org)
Even better, if you have an account there you could do it yourself.
I've just created a bitbucket account, my username is enobayram there as well. It's my first time with bitbucket, but I guess I need some write permissions, right? Also, should I clone it as a git repository or a mercurial repository (what a redundant question )?
If you think my chances of messing something up as a first-time mercurial user multiplied by the amount of time you'll have to spend cleaning it is higher than cloning it yourself, it's perfectly OK for me, if you choose to clone it yourself.
As a side question, what happened to the orx svn repository? Is it abandoned?