1,105,578 Community Members

Variables from C++ into Blender Game Engine

Member Avatar
kshaaban
Newbie Poster
9 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hey everyone!

I have been working on some c++ code which point tracks a user and extrapolates their co-ordinates within 3D space. i have the co-ordinates in c++ stored as variables and would like to use these variables within the Blender game engine to position an object within the scene.

I have had a play with the logic nodes system in blender 2.55 and am quite impressed at how easy it is to control objects within a scene using the nodes. i would like to know if it is possible to somehow get my variables from my c++ code into the game engine?

I have loaned some books on python but as a newb i dont really know where in blender to begin. I think i need to run the API in order to write a script or something but have no idea where to start.

does anyone know how best to approach this?? once i get the general idea i think i will be able to get started but i am having trouble finding the first steps.

thanks!

Member Avatar
Isaac Remuant
Newbie Poster
24 posts since Apr 2010
Reputation Points: 40 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

I'll start by saying I've used blender but I've never used the Game Engine.

Are you trying to export information from a c++ application to be able to read it later from the Blender Game Engine or you're talking about using c++ to manage the it?

If it's the latter, you probably don't have much of a choice but to learn python. Approach it slowly, and you'll probably have no troubles with it. You might even be able to throw some c++ if you need:
http://docs.python.org/extending/extending.html

If it's the former... You can save to any file format of your choosing and loaded with a specific blender importer (or even one of your own making with python)

Member Avatar
kshaaban
Newbie Poster
9 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi Isaac!

Thanks for your post, that clears up some of my question, but im a bit stuck as to where i should for python within the game engine. There is apparently an API however I cant seem to find it.

So other than learning Python, my question really is how would I begin to code for the Game engine instead of using the logic Editor.

EDIT: and yes i would like for both to be running in near realtime. so no pre-existing scripts etc.

thanks

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: