2.50:
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.
This commit is contained in:
45
release/scripts/scripttemplate_gamelogic_module.py
Normal file
45
release/scripts/scripttemplate_gamelogic_module.py
Normal file
@@ -0,0 +1,45 @@
|
||||
#!BPY
|
||||
"""
|
||||
Name: 'GameLogic Module'
|
||||
Blender: 249
|
||||
Group: 'ScriptTemplate'
|
||||
Tooltip: 'Basic template for new game logic modules'
|
||||
"""
|
||||
|
||||
from Blender import Window
|
||||
import bpy
|
||||
|
||||
script_data = \
|
||||
'''
|
||||
# This module can be accessed by a python controller with
|
||||
# its execution method set to 'Module'
|
||||
# * Set the module string to "gamelogic_module.main" (without quotes)
|
||||
# * When renaming the script it MUST have a .py extension
|
||||
# * External text modules are supported as long as they are at
|
||||
# the same location as the blendfile or one of its libraries.
|
||||
|
||||
import GameLogic
|
||||
|
||||
# variables defined here will only be set once when the
|
||||
# module is first imported. Set object spesific vars
|
||||
# inside the function if you intend to use the module
|
||||
# with multiple objects.
|
||||
|
||||
def main(cont):
|
||||
own = cont.owner
|
||||
|
||||
sens = cont.sensors['mySensor']
|
||||
actu = cont.actuators['myActuator']
|
||||
|
||||
if sens.positive:
|
||||
cont.activate(actu)
|
||||
else:
|
||||
cont.deactivate(actu)
|
||||
|
||||
# dont call main(GameLogic.getCurrentController()), the py controller will
|
||||
'''
|
||||
|
||||
new_text = bpy.data.texts.new('gamelogic_module.py')
|
||||
new_text.write(script_data)
|
||||
bpy.data.texts.active = new_text
|
||||
Window.RedrawAll()
|
||||
Reference in New Issue
Block a user