Graphical ORX Animation Editor

edited September 2012 in Projects - Tools
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:

editor_screenshot.png

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!
scrsht 114.4K
«13

Comments

  • edited July 2012
    Hello :)

    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
  • edited July 2012
    Hey!

    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!
  • edited July 2012
    Of course you can add it to you distribution :)
    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.

    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
    There are ways to make image loading possible from jar files
    but it doesn't work since your ImageIcons are static
  • edited July 2012
    Hey! I've added your snap slider to the git repository, as well as the binary. If it's causing troubles on Ubuntu, I'll make it work from the .jar right away :)

    Cheers!
  • jimjim
    edited July 2012
    Hey, nice work enobayram :) it is a very nice tool indeed. We need community made tools more and more. Now, iarwain you see, that's what I was talking about,we definitely need a tools section. Otherwise this post will get lost easily after a few days, and new users will hardly find it :(

    Thanks again enobyram, all hail orx :D
  • edited July 2012
    Thank YOU for your interest in it guys!

    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!
  • edited July 2012
    That's an excellent news! :D

    I'm looking forward to giving it a try over the week end! :)
  • edited July 2012
    Hi Everyone!

    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:

    scrsht-2c55d31911386be698380ed708c10e93.png

    For example, when you choose "Write to Target" for the state of that screenshot, here's the generated .ini file:
    [mySet]
    AnimationList = NewAnimation0#NewAnimation1
    LinkList =NewAnimation12NewAnimation0
    [NewAnimation12NewAnimation0[
    Source      = NewAnimation1
    Destination = NewAnimation0
    [NewAnimation0]
    DefaultKeyDuration   = 0.3
    KeyData1    = NewFrame0
    KeyData2    = NewFrame1
    KeyData3    = NewFrame2
    [NewFrame0]
    Texture           = imagesstonebrick.bmp
    TextureCorner     = (15, 10, 0)
    TextureSize       = (50, 40, 0)
    Pivot             = (25, 20, 0)
    [NewFrame1]
    Texture           = imagesstonebrick.bmp
    TextureCorner     = (10, 30, 0)
    TextureSize       = (45, 25, 0)
    Pivot             = (22, 12, 0)
    [NewFrame2]
    Texture           = imagesstonebrick.bmp
    TextureCorner     = (15, 10, 0)
    TextureSize       = (60, 35, 0)
    Pivot             = (30, 17, 0)
    [NewAnimation1]
    DefaultKeyDuration   = 0.3
    KeyData1    = NewFrame3
    KeyData2    = NewFrame4
    [NewFrame3]
    Texture           = imagesstonebrick.bmp
    TextureCorner     = (10, 40, 0)
    TextureSize       = (40, 20, 0)
    Pivot             = (20, 10, 0)
    [NewFrame4]
    Texture           = imagesstonebrick.bmp
    TextureCorner     = (15, 10, 0)
    TextureSize       = (45, 30, 0)
    Pivot             = (22, 15, 0)
    

    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.
  • edited July 2012
    Nice work, enobayram!

    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. :)
  • edited July 2012
    Thanks iarwain,

    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!
  • edited July 2012
    Is this taking advantage of the new animation subsystem? (I haven't been here for a while, I don't know if it ever got finished ^_^;; )
  • edited July 2012
    Nope, it's spitting out config files with the old way of listing the links separately. However, modifying it for the new system should take no time, I think. If needed, I can add separate options for outputting config files for the old and the new animation subsystems. Note, however, that skeletal animations are not handled by this tool, it's just to edit conventional frame-based animations and animation sets.

    As for the skeletal animations, what do you guys use to edit them?
  • edited July 2012
    I've never animated anything before. I kinda want to try using this one tool called Spriter that started on kickstarter a while back. Looks interesting and easy enough to use.
  • edited July 2012
    I've also got my eyes on Spriter. I guess we should write converters from the Spriter output to the orx config files as soon as it's released. I've started writing this little tool so that we've something simple and free for basic animation editing, but it'd be an overkill to set out for skeletal animations while Spriter is about to be released.
  • edited July 2012
    Thanks, your new binary works just fine for me! :)

    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. :)
  • edited August 2012
    Hi Everyone! I hope you're all having a great summer...

    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 :)
  • edited August 2012
    Nice work!

    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!
  • edited August 2012
    Hi Iarwain,

    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 :)
  • edited September 2012
    Hi everyone!

    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
  • edited September 2012
    Very much looking forward to trying this out tomorrow night. It's just what I need soon when I start the sprite work.
  • edited September 2012
    I just downloaded the newest version of editor and when i clicked to help content it just showed blank window. I dont know if I did something wrong or it doesnt work for me but I definitely like the editor, it is great :)
  • edited September 2012
    Thanks for your interest, I hope it ends up being genuinely useful to people. What I fear the most is to cause people's time to be wasted because of my programming mistakes. That could mostly happen if you had a large animation project that suddenly becomes unusable due to compatibility issues between versions. That's why I would really like to know when people start to invest real effort in it, so that I'm more careful about the compatibility.

    @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!
  • edited September 2012
    Hi again, I've tried the jar file on windows now and I've also experienced the blank help view. Now I've fixed that problem and uploaded a new version of the jar file. Please let me know if the problem persists on your end.

    Cheers :)
  • edited September 2012
    Everything work just fine now, good job :)
  • edited September 2012
    Hi everyone,

    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.
  • edited September 2012
    Heh, no worries about any spam, it's great info knowing about all your progress there, so don't hesitate to post about it here! :)

    I'm sure the silent majority of us are interested as well. :)
  • edited September 2012
    Great! It's nice to know that the friendly ORX community is watching :)

    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?
  • edited September 2012
    Thanks, enobayram. Yes you're right the stepping of the main sprite in the game is not as good as the lo-res one because I got tired of re-adjusting the sprites each time I made a change to the frames. I decided to wait towards the end to fix this up.

    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?
  • edited September 2012
    Yes I know of one! :) :)

    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 :)
  • edited September 2012
    Two words: event synchronization. ;)

    That'd be nice if we could do it inside your editor, for sure. :)
Sign In or Register to comment.