Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Question: How does one export Game Logic ("Sensors") that Unity references for controlling actions from Blender's "Action Editor" or "Dope Sheet"?

Problem Statement: I have a Blender model that has game logic sensors that respond to complex input. These Actions are defined in Blender's "Action Editor" or "Dope Sheet". What is the easiest way to export the game logic so that I have access to its input that causes the actions? There are many exporters that focus on the mesh/skeleton, is there a solution for exporting these sensors?

Specifics: Here is a list with screen shots of Blender's sensors to give a better idea of what I want exported: http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Game_Engine/BSoD/Sensors,_Controllers,_Actuators

For each character made, I want their sensors exported to a file that is easy to read (some kind of xml). This way I don't need to hard code character behavior or action triggers/sensors - each modeled Blender actor can have its sensors programmed in Blender with its nice GUI and later exported to my game engine.

Research: This question has been asked before and it seems the asker ended up scripting a very limited exporter (for 1 variable) but didn't fully explain his approach: http://www.blender.org/forum/viewtopic.php?t=18803&sid=22ac4b2d3993949b1e71e9568b0d6834

Again, this was asked with no apparent solution: http://www.blender.org/forum/viewtopic.php?t=18803&sid=22ac4b2d3993949b1e71e9568b0d6834

Looks like someone has already tried using collada but this was only for exporting actions (not sensors that trigger them): Blender multiple animations and Collada export

Someone here wrote their own exporter. I don't think they are exporting sensors though: exporting bind and keyframe bone poses from blender to use in OpenGL

Any ideas? Thanks!

share|improve this question
    
I'm currently writing my own exporter for blender, which exports to a custom format. Looking at the other included exporter scripts helped me a lot. Actions are represented internally by blender.org/documentation/blender_python_api_2_66a_release/…. –  sarahm Mar 18 '13 at 7:12
    
thank you. I am starting to believe the only solution is to code my own! This is great for exporting actions. I updated my question, it now specifically defines "game logic sensors" as my major concern (I didn't have the wording right before). Here is the api for sensors:blender.org/documentation/blender_python_api_2_66a_release/… –  ecoe Mar 18 '13 at 17:23

3 Answers 3

As for the mesh/skeleton export. You can do using the simple Wavefront (.obj) exporter. This file is readable by most physic/3d engines. Or the Blender to FBX exporter :)

I am not exactly sure how does the action import work in the engines you noted. But many game engines have their own systems when it comes logic mechanics. UnityScript, HeroScript, UnrealScript and so on. You might have to export just the rigs, meshes, skelets and animations seperately. To set it up one by one inside the other engine using the internal game engine language.

share|improve this answer
    
If that is the case I might try to create my own exporter for the action editor and then have an importer that then translates things for the game engine. This is useful because my friend can animate without programming using the action editor. I don't have a high enough reputation to +1 your response, but thank you it is helpful. –  ecoe Mar 16 '13 at 21:58
1  
Correct me if i'm wrong, but .obj doesnt really support skeletal animation. It exports your stuff on a key-frame basis (there is an .obj file for every key frame in your animation). This is most likely not the desired result. –  Tyrfing Mar 17 '13 at 16:42
    
my aim is more centered towards utilizing Blender's "Action Editor". So, for the time being we are simply exporting .png files and reading them from a file directory (a 2D game). exporting skeleton's/meshes is sort of secondary until we implement a 3D game. So, I actually dont know the first thing about .obj! Thanks though! –  ecoe Mar 17 '13 at 18:48
    
So do you want 3D model output with actions? Or a 2D spritesheet animation? –  indeed005 Mar 18 '13 at 3:06
1  
lol, yes sorry for the confusion. For now 2D later 3D. My animator likes blender too so we are comfortable exporting screen shots. Whether it is 2D or 3D we would couple our game logic to the dope sheet (e.g. extend its eventual schema representation with an image directory element or some kind of pointer to where the right animation images are). –  ecoe Mar 18 '13 at 16:37

If you don't need some more advanced engine features then alternative approach would be to use Blender's own game engine. Some games using it: Dead Cyborg, Yo Frankie!.

share|improve this answer
    
I do need advanced game engine features, sorry if my question confuses. I am trying really hard to word it more concisely. I have just edited it further. I am using pygame and will eventually move on to pyogre3D or Panda3D. For now, I want a quick and easy way to animate in blender and then convert that into 2D (or later 3D) and in that conversion process maintain the key input designated by Blender's "Action Editor" or "DopeSheet". Thanks for your response! Hope this clarifies also! –  ecoe Mar 16 '13 at 22:49

I am using the InterQuake model exporter (.iqm/.iqe files) for my projects. You can find the exporter here. It's a lightweight format which doesn't get as bloated as Collada and supports Skeletal Animation, basic texturing, etc.

It does not, however, support exporting Dope Sheets. The reason I am recommending the format is because the provided exporter itself is also rather lightweight, so you can easily edit it to suit your needs.

share|improve this answer
    
thank you. Again, I don't have a high enough reputation to +1 but this was helpful. This was also suggested in the first link I posted so maybe I will check it out. Otherwise, I may also just script something in blender to export the dope sheet. Still waiting to see if anyone has experience with this. –  ecoe Mar 17 '13 at 18:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.