[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36318] branches/bge_components/release/ scripts/bge_components: Removed some testing code in camera.py and made " Front Wheel Drive" and "Rear Wheel Drive" mutually exclusive by using the new set notation for a menu argument.
Mitchell Stokes
mogurijin at gmail.com
Mon Apr 25 06:37:00 CEST 2011
Revision: 36318
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36318
Author: moguri
Date: 2011-04-25 04:36:59 +0000 (Mon, 25 Apr 2011)
Log Message:
-----------
Removed some testing code in camera.py and made "Front Wheel Drive" and "Rear Wheel Drive" mutually exclusive by using the new set notation for a menu argument.
Modified Paths:
--------------
branches/bge_components/release/scripts/bge_components/camera.py
branches/bge_components/release/scripts/bge_components/vehicle.py
Modified: branches/bge_components/release/scripts/bge_components/camera.py
===================================================================
--- branches/bge_components/release/scripts/bge_components/camera.py 2011-04-25 03:02:26 UTC (rev 36317)
+++ branches/bge_components/release/scripts/bge_components/camera.py 2011-04-25 04:36:59 UTC (rev 36318)
@@ -10,7 +10,6 @@
("Lens", 30),
("Scale Max", 4.0),
("Scale Min", 0.6),
- ("Option", {"One", "Two"})
])
def start(self, args):
@@ -18,7 +17,6 @@
if not isinstance(self.object, bge.types.KX_Camera):
raise TypeError("This component must be attached to a camera")
- print(args['Option'])
# Apply settings
self.object.parent.timeOffset = args['Time Offset']
self.object.lens = args['Lens']
Modified: branches/bge_components/release/scripts/bge_components/vehicle.py
===================================================================
--- branches/bge_components/release/scripts/bge_components/vehicle.py 2011-04-25 03:02:26 UTC (rev 36317)
+++ branches/bge_components/release/scripts/bge_components/vehicle.py 2011-04-25 04:36:59 UTC (rev 36318)
@@ -19,8 +19,7 @@
("Brake Power", 10.0),
("Turn Power", 0.3),
- ("Front Wheel Drive", True),
- ("Rear Wheel Drive", False),
+ ("Drive Type", {"Front Wheel", "Rear Wheel"}),
("Tire Prefix", "tire_"),
("Front Tire Radius", 0.3),
("Rear Tire Radius", 0.3),
@@ -41,8 +40,8 @@
self.turn = args['Turn Power']
# Save steering settings
- self.fwd = args['Front Wheel Drive']
- self.rwd = args['Rear Wheel Drive']
+ self.fwd = args['Drive Type'] == "Front Wheel"
+ self.rwd = args['Drive Type'] == "Rear Wheel"
# Create the vehicle constraint
constraint = bge.constraints.createConstraint(self.object.getPhysicsId(), 0, 11)
@@ -89,7 +88,7 @@
args['Front Tire Radius'] if i in (0, 1) else args['Rear Tire Radius'],
# Steerability
- args['Front Wheel Drive'] if i in (2, 3) else args['Rear Wheel Drive'])
+ self.fwd if i in (2, 3) else self.rwd)
# Advanced settings
vid.setTyreFriction(args['Tire Friction'], i)
More information about the Bf-blender-cvs
mailing list