I am currently working on a project that combines C++ with Python. The idea is that we use sensors to measure distances, translate this through C++ to Python and the Blender Game Engine into a movement. We use Blender 2.57b I am having some strange bugs though:
For some reason I can’t just import classes and use their functions in Python. I have looked through tons of tutorials/examples and lessons and other people are able to use these functions, but self or imported functions such as pointer are being recognized without clearly stating their whole path.
I am having a strange error with this bit of code:
>> values = Types.Sensor() >> Types.DLL.GetSensorStatus(Types.Motor.MOTOR1, ctypes.pointer(values)) ValueError: procedure probably called with too many arguments (8 bytes in excess)
The called function in C++ looks like this:
bool GetSensorStatus(Motor aMotor, Sensor &SensorValue)
Anyone have any idea what can cause this?
- I am using the following code to rotate objects:
locArmL = bpy.data.objects.get('loc.l') locArmL.rotation_euler = angle
However this code doesn’t seem to work in the game engine itself, but it does work in the 3d view. So when I exit the game after running this code a few times without results, I suddenly find the objects rotated in the 3d view.
I want the rotation to be a fixed amount every time and I want to call it through Python without using logic bricks. Anyone know how?