forked from bartvdbraak/blender
c8b4cf9206
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD Notes: * Game and sequencer RNA, and sequencer header are now out of date a bit after changes in trunk. * I didn't know how to port these bugfixes, most likely they are not needed anymore. * Fix "duplicate strip" always increase the user count for ipo. * IPO pinning on sequencer strips was lost during Undo.
34 lines
555 B
Python
34 lines
555 B
Python
#!BPY
|
|
"""
|
|
Name: 'GameLogic Template'
|
|
Blender: 249
|
|
Group: 'ScriptTemplate'
|
|
Tooltip: 'Basic template for new game logic scripts'
|
|
"""
|
|
|
|
from Blender import Window
|
|
import bpy
|
|
|
|
script_data = \
|
|
'''
|
|
def main():
|
|
|
|
cont = GameLogic.getCurrentController()
|
|
own = cont.owner
|
|
|
|
sens = cont.sensors['mySensor']
|
|
actu = cont.actuators['myActuator']
|
|
|
|
if sens.positive:
|
|
cont.activate(actu)
|
|
else:
|
|
cont.deactivate(actu)
|
|
|
|
main()
|
|
'''
|
|
|
|
new_text = bpy.data.texts.new('gamelogic_simple.py')
|
|
new_text.write(script_data)
|
|
bpy.data.texts.active = new_text
|
|
Window.RedrawAll()
|