Blender Game Data Plug-in

I have released the first version of plug-in that allows access game data of Blender objects from Python. Just recently I read about Ogre plugin development, so I stopped plans for all covering module. It will just give access to functions and data, that aren’t accessible from Blender API and I (or anybody else) will need access to.

it’s great, ashid,and i hope to be able to be able to use it, but why don’t you just add this to cvs as a part of the engine?

sorry just looked at it, it’s in fact not for engine, but very useful, it would be also great to be able to create bricks from python.

It won’t get into Blender source, because some of this functionality is already included in upcoming version 2.42. I’m working on the next version, that will allow to access logic bricks.

Actual result of script that exports game scene to our game engine based on Ogre and Ode. It uses plug-in to access physical data in blender. My aim is to create one-click export of game scene from Blender to our engine, so that designer can run scene directly on our engine. Export script is currently under development and is specific for our scene reprezentation.
Screen of scene in Blender:
http://ashsid.szm.sk/images/odysDemo1.jpg
Scene exported in our game engine (including camera and lights):
http://ashsid.szm.sk/images/odysDemo2.jpg

I have started new step in development of blendGame plug-in. Currently is available read/write access to physical data, read access to common structures of properties, sensors, controllers and actuators + access to keyboard sensor specific data. It under heavy development, so every day are new classes and methods added.

I would like to know if is there some interest in such kind of functionality and what is the most wanted feature.

Personally I’m really intrested in being able to create games completely with python using blender’s game engine. Right now you can only use python scripts if you add some logic bricks to it. It would be cool to be able to create games completely without logic bricks, or as less as possible. :slight_smile:

^what JD_multi said

This plug-in isn’t aimed to replace logic bricks. Its purpose is to access physic data and logic bricks using python scripts. It can be used to export data from logic bricks to other game engine or to construct new logic bricks using python scripts.

Hi ashsid.
I was just in the need of this. I downloaded but when I run the sample I get error that blendGame does not exists. Can you provide me a way to use it?

oops I found it. I just had to place the dll in the blender dir. Sorry aboy that.

Are you planing to add the ability to add sensors , controllers and actuators to the Objects? This is what I was hoping to do with this plug in.

haramanai,

actually I have uploaded new version of this plugin. I develop it in parallel with ODYS engine exporter and it’s primary purpose is to read data from Blender structures.

But I’m considering that I’ll add ability to change or add game data in Blender. Currently I’m too busy on other projects, but this plugin is open sourced - so if anyone wants add any functionality to it, he is able to do so. Personally I will wait until Blender 2.43 will be released, then I update my plugins to reflect changes and then I’ll consider adding new functionality.

I have uploaded new version of blendGame plugin. It contains read / write access from Python scripts to:

  • gravity in World object
  • game and physic settings in game object (on the left side of Logic buttons)
  • creation and destruction of logic bricks -sensors, controllers, actuators of all types
  • linking and unlinking logic bricks
  • specific data of some types of logic bricks (keyboard and mouse sensors, all types of controllers, motion and action actuators)

If anybody is interested I can post some code examples…

yeah man, thanks very much for your works
just i need this …
i interested some examples for learn this module

Basic example that shows initialization, object creation, access to attributes…

import Blender
import blendGame
 
o = Blender.Object.GetSelected()[0]
go = blendGame.Object(o)   # get game object
go.actor = True     # set game object attribute
print go.mass, go.radius   # print game object attributes
s = go.addSensor(3, 'kbsens')       # add keyboard sensor to object , parameters (type, name)
sk = s.getData()        # get specific keyboard sensor data
sk.key = (Blender.Draw.ZKEY,)    # set key and modifiers (as tuple)
s.freq = 10         # set sensor frequency (common for sensor types)
c = go.addController(0, 'andCont')       # create AND controller
s.linkController(c)          # link controller to sensor
a = go.addActuator(0, 'motionAct')        # create motion actuator
am = a.getData()           # get specific motion actuator data
am.linV = [5, 0, 0.7]       # set linear velocity vector
c.linkActuator(a)         # link actuator to controller

where is that plugin now?

A few years in the past it seems…