Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-05 01:41:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-05 01:41:05 +0400
commit2a140e93c173b4f358b15723c2d00f3c8bf292bb (patch)
tree1cd0ed6f759d3fb35946a64336442ba40efacf38 /release/scripts/templates
parent9f22750422940681dba14839a762c6f8bf02dba6 (diff)
style cleanup
Diffstat (limited to 'release/scripts/templates')
-rw-r--r--release/scripts/templates/addon_add_object.py2
-rw-r--r--release/scripts/templates/gamelogic.py28
-rw-r--r--release/scripts/templates/ui_panel_simple.py4
3 files changed, 17 insertions, 17 deletions
diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py
index 3900f595584..a2d7315af4b 100644
--- a/release/scripts/templates/addon_add_object.py
+++ b/release/scripts/templates/addon_add_object.py
@@ -65,7 +65,7 @@ def add_object_button(self, context):
self.layout.operator(
OBJECT_OT_add_object.bl_idname,
text="Add Object",
- icon="PLUGIN")
+ icon='PLUGIN')
def register():
diff --git a/release/scripts/templates/gamelogic.py b/release/scripts/templates/gamelogic.py
index c6d15850a4e..01ac27c56cd 100644
--- a/release/scripts/templates/gamelogic.py
+++ b/release/scripts/templates/gamelogic.py
@@ -21,23 +21,23 @@ def main():
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
- print('Logic info for KX_GameObject', own.name)
+ print("Logic info for KX_GameObject", own.name)
input = False
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.owner
- print(' sensor:', sens.name, end=' ')
+ print(" sensor:", sens.name, end=" ")
if sens.positive:
- print('(true)')
+ print("(true)")
input = True
else:
- print('(false)')
+ print("(false)")
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.owner
- print(' actuator:', actu.name)
+ print(" actuator:", actu.name)
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
@@ -49,25 +49,25 @@ def main():
# Its also good practice to get sensors and actuators by name
# rather then index so any changes to their order wont break the script.
- # sens_key = cont.sensors['key_sensor']
- # actu_motion = cont.actuators['motion']
+ # sens_key = cont.sensors["key_sensor"]
+ # actu_motion = cont.actuators["motion"]
# Loop through all other objects in the scene
sce = bge.logic.getCurrentScene()
- print('Scene Objects:', sce.name)
+ print("Scene Objects:", sce.name)
for ob in sce.objects:
- print(' ', ob.name, ob.worldPosition)
+ print(" ", ob.name, ob.worldPosition)
# Example where collision objects are checked for their properties
# adding to our objects "life" property
"""
- actu_collide = cont.sensors['collision_sens']
+ actu_collide = cont.sensors["collision_sens"]
for ob in actu_collide.objectHitList:
# Check to see the object has this property
- if ob.has_key('life'):
- own['life'] += ob['life']
- ob['life'] = 0
- print(own['life'])
+ if "life" in ob:
+ own["life"] += ob["life"]
+ ob["life"] = 0
+ print(own["life"])
"""
main()
diff --git a/release/scripts/templates/ui_panel_simple.py b/release/scripts/templates/ui_panel_simple.py
index 6226240ff87..3fab7d92675 100644
--- a/release/scripts/templates/ui_panel_simple.py
+++ b/release/scripts/templates/ui_panel_simple.py
@@ -5,8 +5,8 @@ class HelloWorldPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Hello World Panel"
bl_idname = "OBJECT_PT_hello"
- bl_space_type = "PROPERTIES"
- bl_region_type = "WINDOW"
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):