[x3d-public] Python, the emperor has no clothes!
Don Brutzman
brutzman at nps.edu
Mon Apr 20 23:27:49 PDT 2020
Excellent catch. As you indicated, the problem was SFNode fields had improper toXML implementation. Now fixed, test case added to smoke tests, checked in and deployed as v0.0.26
On 4/20/2020 8:57 AM, John Carlson wrote:
> testing toXML in python. BackgroundCollection.py works.
>
> These don't:
> $ python HelloWorld.py
> x3d.py package loaded, have fun with X3D Graphics!
> Traceback (most recent call last):
> File "HelloWorld.py", line 77, in <module>
> print ( newModel.toXML())
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 6878, in toXML
> result += str(self.Scene.toXML(indentLevel=indentLevel+1))
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 6679, in toXML
> result += each.toXML(indentLevel=indentLevel+1)
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 19183, in toXML
> result += each.toXML(indentLevel=indentLevel+1)
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 40543, in toXML
> result += each.toXML(indentLevel=indentLevel+1)
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 35796, in toXML
> for each in self.appearance:
> TypeError: 'Appearance' object is not iterable
>
> coderextreme at DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/python/examples <http://www.web3d.org/x3d/stylesheets/python/examples>
> $ python HelloWorldPrefixed.py
> x3d.py package loaded, have fun with X3D Graphics!
> Traceback (most recent call last):
> File "HelloWorldPrefixed.py", line 77, in <module>
> print ( newModel.toXML())
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 6878, in toXML
> result += str(self.Scene.toXML(indentLevel=indentLevel+1))
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 6679, in toXML
> result += each.toXML(indentLevel=indentLevel+1)
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 19183, in toXML
> result += each.toXML(indentLevel=indentLevel+1)
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 40543, in toXML
> result += each.toXML(indentLevel=indentLevel+1)
> File "C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\python\examples\x3d.py", line 35796, in toXML
> for each in self.appearance:
> TypeError: 'Appearance' object is not iterable
>
> -----------------------
>
> Appearance is an SFNode, so it's not a iterable.
>
> [...]
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list