2
\$\begingroup\$

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

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?

Here is a list with screen shots of Blender's sensors to give a better idea of what I want exported.

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.

This question has been asked before and it seems the asker ended up scripting a very limited exporter (for one variable) but didn't fully explain his approach: Link

Again, this was asked with no apparent solution: Link

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?

\$\endgroup\$
2
  • \$\begingroup\$ 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/…. \$\endgroup\$
    – Exilyth
    Commented Mar 18, 2013 at 7:12
  • \$\begingroup\$ 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/… \$\endgroup\$
    – ecoe
    Commented Mar 18, 2013 at 17:23

3 Answers 3

1
\$\begingroup\$

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.

\$\endgroup\$
6
  • \$\begingroup\$ 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. \$\endgroup\$
    – ecoe
    Commented Mar 16, 2013 at 21:58
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Tyrfing
    Commented Mar 17, 2013 at 16:42
  • \$\begingroup\$ 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! \$\endgroup\$
    – ecoe
    Commented Mar 17, 2013 at 18:48
  • \$\begingroup\$ So do you want 3D model output with actions? Or a 2D spritesheet animation? \$\endgroup\$
    – indeed005
    Commented Mar 18, 2013 at 3:06
  • 1
    \$\begingroup\$ 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). \$\endgroup\$
    – ecoe
    Commented Mar 18, 2013 at 16:37
1
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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. \$\endgroup\$
    – ecoe
    Commented Mar 17, 2013 at 18:03
0
\$\begingroup\$

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!.

\$\endgroup\$
1
  • \$\begingroup\$ 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! \$\endgroup\$
    – ecoe
    Commented Mar 16, 2013 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .