Double output in console

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
apollo
Posts: 0
Joined: Tue Jun 30, 2009 4:56 pm
Location: Sweden

Double output in console

Post by apollo »

Hi people,

I'm yet another newbie with Blender and Python so please forgive my very basic level questions. One of those things that I'm getting some trouble is when executing a very simple line like

print "hello"

from a script in a Python controller connected to a Keyboard sensor every time I click the Space bar. So my problem is that I get double output:

hello
hello

it's maybe not a big thing but when I want to know the distance between two objects or which objects I have in my scene I get confused due to this "bug". The .blend file is just a Cube and the python script contains that only line (print "hello") Does anybody know how I can get a single output or is it supposed to be like this? Thanks for any help,

Apollo

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing »

You're getting signals for both press and release of key.

/Nathan

apollo
Posts: 0
Joined: Tue Jun 30, 2009 4:56 pm
Location: Sweden

Post by apollo »

jesterKing wrote:You're getting signals for both press and release of key.

/Nathan
yeap, that could be it... but can't find how to fix this. Any ideas on how to specifically tell Blender to activate on press OR on release of a key???

Post Reply