From: Bruce S. <Bru...@nc...> - 2011-03-01 17:45:13
|
Thanks much for the report. In vis/primitives.py, the code for changing color and material for a text object should look like this: def set_material(self, material): self.extrusion.material = material def get_material(self): return self.__material def set_color(self, color): self.extrusion.color = color def get_color(self): return self.__color These corrections will of course be in the next update to VPython. I also found a mistake in text.starts, but that's less used. History: The year-old 3D text object had a component to convert text to contours, and Python code to generate faces objects to render the 3D text. With the new extrusion object also needing to be able to convert text to contours, that subroutine was split out as shapes.text() and the text and extrusion objects both call shapes.text(). In the process of doing this restructuring I failed to change the setters for text.color and text.material. Note that the text object creates an extrusion object, but this doesn't make the text object obsolete, because it places emphasis on such things as upper left and lower right locations, etc. Bruce Sherwood On Tue, Mar 1, 2011 at 2:54 AM, Symion <kn...@ip...> wrote: > I have been exploring the Text object a little more and may have found a > bug. > I may not be using the text object correctly but I receive the following > error when changing text color. > > from visual import * > words = text(text="Test") > words.color=(1,0,0) > > Traceback (most recent call last): > File "<pyshell#118>", line 1 > words.color=(1,0,0) > File "C:\Python27\lib\site-packages\vis\primitives.py", line 945, in > set_color > for line in range(len(self.lines)): > AttributeError: 'text' object has no attribute 'lines' > > The same error occurs with. > > words.starts.__class__ > > > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT data > generated by your applications, servers and devices whether physical, virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |