Panda3D logic bricks exporter

Hi everyone,

As part of encouraging the support for other game engines from within Blender, it’s been noted that logic bricks are a fundamental attraction for users of the BGE. This is not to say that they’re the best form of logic editor (or even particularly good at all), but they do serve a purpose, which is otherwise (at the moment, without HIVE) unfilled. Whilst I hope to encourage these users (and even die-hard python scripters) to explore the benefits of HIVE (and support within Panda3D), it’s not ready for use at this present time (a second, refactored code base is currently being developed).

As a means of easing any hypothetical transition, it would be beneficial to be able to export Logic Brick setups to other engines, and run them inside of a logic manager. I’ve written a basic system for exploration of this concept in Panda3D, which can be found at my GitHub.

Hopefully, interested developers can take a look and consider forking and developing this into a more functional prototype, as it stands, it only supports the Always sensor, limited keyboard and motion actuators, and all but the expression controller. In addition, the python controllers wouldn’t natively support the logic bricks without a bridge (which might also be useful), as the BGE vs panda API are vastly different.

Anyway, whilst this is not a functional tool at the moment (very limited behaviour, many aspects (i.e logic binding, dynamic instancing) are not supported), it might be fun to check out.

Nice work :wink:

any chance most of my python could be portable?

do you have sensors tied to events the same in panda?

I know I may need to translate,
but is there some sort of ninja find replace you could do that preserves the arguments?

Side note… panda is also not android ready correct?

It says you deleted the video…

Most of the time, it’s a complete paradigm shift, so your expression of logic will not map into Panda design requirements.

The easiest solution to this, that I can think of, is either:

  • Write a general-purpose API for both engines, so that scripts can be directly copied from one to the other. Good for adding > 1 external engine, though unlikely many will use Python anyway. Limited ability to use this to transpile into other languages.
  • Write a BGE proxy API for Panda3D, to allow immediate use of BGE scripts in Panda. Creates some teething problems later on as users use old scripts, but good for experimenting. Requires significant amount of code.

There is some work on an Android port here

I had accidentally left an in-house addon running inside Blender.

Ah okay, understandable. Great addon! Maybe we could use this as a template for converting logic bricks to scripts for other engines or even just converting it to BGEPython! :smiley:

You could, honestly the exporter is just a glorified attribute dump (taking care to remove python-garbage, convert vectors to tuples and remove references to linked SCA bricks (just using their unique names))
Most of the code is in the Python-implementation of the SCA evaluation loop (and the actual function of the logic bricks in Python)

I love logic bricks myself.I like how easy it is to put aniimations on npcs and player characters.And how easy it is to make a dialogue systems and npcs.I tried unity and had trouble learning it.I would like that they would not get harder to use.If this really takes off.I would like blend demonstrations,pictures of logic brick settups,written tutorials,and videotutorials.I would like to be able to copy and paste logic bricks in it to different types meshes and armatures.

Hi @agoose77,

I have a wish: On your github account, can you fiel out the “” file with explanations, please?
Thks and Congrats.