blob: 1584659d3176f13130ff84dcc673f34181568f58 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!BPY
"""
Name: 'GameLogic Template'
Blender: 245
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.getOwner()
sens = cont.getSensor('mySensor')
actu = cont.getActuator('myActuator')
if sens.isPositive():
GameLogic.addActiveActuator(actu, True)
else:
GameLogic.addActiveActuator(actu, False)
main()
'''
new_text = bpy.data.texts.new('gamelogic_simple.py')
new_text.write(script_data)
bpy.data.texts.active = new_text
Window.RedrawAll()
|