-1
$\begingroup$

Good afternoon people. I'm new to Blender and I have a problem , which I think is a simple solution , but I can not solve.

I have an application for BlenderGame , I have an object that moves the read from a CSV coordinates. Until then all Ok . This object has the data coordinate Desirable, and coordinate it performs for a PID control.

I would like to create a line or cylinder with coordinated the object should perform . A reference line. I do this with Python code at runtime . When I click on "P" and the Blender Game run the application , the line created , does not appear in the world. But when I give "ESC " to end execution , the line is there. But still it does not appear when I run . It seems that it is not in the correct context.

The code that creates the line via Python is basically this : python script that reads text file containing coordinates and creates a path/curve for object to follow I thank anyone who can guide me. hug

image: https://scontent.fpoa3-1.fna.fbcdn.net/v/t1.0-9/14224860_1249837188401329_8188713497222516318_n.jpg?oh=b9778e78077a06365aaf972e53964b55&oe=5845F72D

$\endgroup$
1
$\begingroup$

Never ever use bpy in your BGE game.

  • bpy is the Blender API. It talks with Blender. Blender is NOT the game engine. It is not available in your final game. It is available at development time when you run your game embedded in Blender. Read access will retrieve data from the Blender data. Write access updates the Blender session. It will not take effect until you end the embedded game session.
  • bge is the BGE API. It talks with the Blender Game Engine. This is the API you need to use.
  • mathutils is a library available in both Blender and the BGE. It is stateless and therefore has no visible difference if used from Blender or the BGE.

I hope this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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