Hi all, after a long time, loads of coffee, hundreds of hours of work and 160 commits I finally present you: the orxEditor!
This is my attempt to create a what you see is what you get editor for ORX.
As of now it supports: multiple objects selection, camera groups, visual collision edition and the loading of sprites. It runs on Linux and Windows (though created scenes will only load in the system they were created) and should
run on OSX (I don't have one to test, so I can't be sure).
Here is a screen shot of the scene in the editor and on orx:
Finally I want to thank iarwain and sausage for all the support they gave me during this project as well as for the grammar review of the project wiki.
I am focusing some upgrades in the collision forms editor as well as a major revamp of the UI (I know, it looks terrible on high resolution screens).
Please, keep in mind that this is still a very early version so the editor may crash (I tried my best to make it crash, but
had no problems in my PC).
Any bug reports and suggestions are welcome.
04/01/2015 - Some updates in the collsion form editor:
- The editor will now check if the mesh is Convex (the mesh will become red if it is not valid).
- Added the option to move the form instead of a single point by holding control.
- Added the option to move all points of the form, keeping the form ratio by using the right button.
stupid question: how do I run the editor?
1) Install Python.
2) Install Kivy (http://kivy.org/#download). The editor was developed and tested using Kivy 1.8, so it is highly advisable that you use this version.
3) Open a command or a terminal.
4) (Windows only) Get to the folder you installed kivy (in the command shell), and execute the 'kivy.bat'.
5) Get to the folder you cloned the repository and execute: 'python tileeditor.py'
This should be the normal flow, I tried on linux (ubuntu) and windows 32 (vista) and 64 (vista and 8), if you have problems, please tell me what OS you are using
PS: I have a meeting now I probably will only be able to look at your reply in about four hours.
As far as I can see, you're using the standard Python ConfigParser for parsing .ini files, and you don't seem to handle any orx-specific .ini expressions, such as inheritance. This is actually the same with the Orx Animation Editor, as a matter of fact, it's much worse with the Animation Editor, since it doesn't parse .ini files at all, it just generates them.
How do you plan to handle the .ini parsing in the long run? Do you intend to be able to parse any existing .ini file and use the editor on it? If yes, we have a common problem, as I also intend to(with Sausage's suggestion) enable the Animation Editor to parse existing Orx projects.
The Animation Editor is in Java, but all the solution alternatives I have in mind would be trivially transferable to Python as well.
What do you think? Would orxEditor benefit from a true Orx .ini parser?
I haven't really put much thinking into the algorithm, at first my idea was to parse by sections and recursively load the properties of the children first, then override the properties correctly.
Still I need to find a way to determine what the section refers to (orxObject, orxCamera, etc) and to validate the data.
Then even when you get the parser going, it's a big task to represent the complex relations the sections could have amongst themselves. For instance, when I first designed the animation editor, each animation contained a number of frames in a hierarchical manner, while in .ini files, many animations can contain the same frame, so it's not really hierarchical. What's worse is that multiple frames could share certain values through inheritance or explicit reference to each other.
It's a tough job to represent the true nature of the sections in a GUI, and I guess that's the fundamental reason why plaintext configuration is always more flexible than graphical tools. That's not to say graphical tools don't have a place (If I thought that, I wouldn't work on the animation editor anyway), but it's a big challenge to try to replace the .ini files entirely, even for something as specific as animations.
Maybe it would be the way to go.
There's some discussion about this on the animation editor thread , there seems to be two viable alternatives:+
2. There's a very nice tool called SWIG, it's used to create bindings for C/C++ libraries, and it can target many (>15) languages including Java and Python. I've been very happily using it for a very long time, and it creates very natural interfaces in the target language. The downside of this alternative is that, SWIG generates some C/C++ glue code that you need to compile for each platform that you're planning to use it.
Iarwain kindly offered to perform the compilation of (2) on orx's build servers, so that's a big help. I've been mildly leaning towards (1) since it's truly cross-platform, but it would be convenient for Java only. Since many nice tools are being built by the community using various languages, maybe it's best to go with (2). And who knows, (2) could evolve to be a complete binding of orx (and not just the config module) and people could use it in any of the 15 languages that SWIG supports. I believe it could even be extended to run on mobile, so that you could write cross-desktop-mobile orx applications using Python! At this point, this is just an ambitious dream of course
On ambition, let's go on with baby steps.
I'll write to Iarwain on the animation editor thread about how to proceed with the compilation and distribution of the SWIG generated interfaces. In the end, we should have ready-to-use orx bindings for various platforms.
I have been working in recreating the UI and adding a few features. Here is a screenshot of the work being is done:
There is still a long way to go, but now there is a mini map and most things have a description. I am trying to also add buttons to do things that right now are only available shortcuts.
I also mean to have some distributable package for easy instalation, at least on windows. Hope you guys like it and any suggestions are always welcome.
don't know if it's on purpose, but I have this message for the last screenshot
"You need permission
Want in? Ask the owner for access, or switch to an account with permission"
Also Kivi 1.8 is recommended, but only 1.9 seems to be available. Should a direct link to 1.8 be provided in the editor wiki if one can be found? Or will it run ok with 1.9?
The new UI is pretty much finished right now and uses kivy 1.9, so if you want to use that branch instead (the viewer is still not working on 64 bits linux). I still want to update the wiki or create some youtube tutorial before merging with the master.
I would love to hear some opinions on it.
The "stable" commit is this c53e27763ee7199447ab3708f3167fa7bdc40e75.
There are still a few functionalities I want to add before merging with the master, so this should be the most stable commit in the next days.
I guess I can't get away with doing that?
But I didn't have an offical python available as such. But it all went through and executed.
That bat file probably sets the environment to use that python and add the path to the kivy libraries.
If so that would remove one barrier to installing the editor for people wanting to try it without much fuss.
I would love to know if anyone is having any trouble, since I assume it will work for everyone.