|
From: Jonathan B. <jbr...@ea...> - 2005-01-03 17:40:55
|
On Sun, 2005-01-02 at 20:09 -0800, Toan T Nguyen wrote:
> > But I want to have different color for some faces. Can somebody help?
> > Thanks a lot.
When you make a bug report, please include a complete working example.
Try this patch. You don't need to rebuild VPython to apply it, just
apply it to the files installed in the site-packages directory. I've
already committed it to CVS.
-Jonathan Brandmeyer
Index: visual/primitives.py
===================================================================
RCS
file: /cvsroot/visualpython/vpython/site-packages/visual/primitives.py,v
retrieving revision 1.1
diff -u -r1.1 primitives.py
--- visual/primitives.py 22 Dec 2004 16:25:15 -0000 1.1
+++ visual/primitives.py 3 Jan 2005 17:30:37 -0000
@@ -31,6 +31,13 @@
del keywords['frame']
else:
frame = None
+
+ # Add special handling for the faces object.
+ if displayobject.__class__ == faces:
+ if keywords.has_key('pos'):
+ displayobject.pos = keywords['pos']
+ del keywords['pos']
+
# Some objects (like the curve and convex) need to have color
set before # pos if color is a single tuple.
if keywords.has_key('color'):
@@ -38,11 +45,6 @@
del keywords['color']
else:
displayobject.color = display.foreground
- # Add special handling for the faces object.
- if displayobject.__class__ == faces:
- if keywords.has_key('pos'):
- displayobject.pos = keywords['pos']
- del keywords['pos']
# Assign all other properties
for key, value in keywords.iteritems():
|