[x3d-public] x3d.py error; fixed and deployed

Andreas Plesch andreasplesch at gmail.com
Thu Apr 23 14:48:37 PDT 2020


I can confirm Inline(url=['a']) works now with x3d-0.0.27:

>>> x3d.Inline(url=['a']).toXML()
"<Inline url='['a']'/>\n"
>>>

-Andreas

On Thu, Apr 23, 2020 at 3:14 PM Don Brutzman <brutzman at nps.edu> wrote:
>
> Thanks for trouble report.  This was similar to error a few days ago, common cause was incorrect handling of MFString fields by toXML() method.
>
> Now fixed and deployed.  I've performed regression tests on about 4000 models, have ~30 Traceback errors to continue diagnosis on.  So... toXML() is pretty much implemented now!
>
> * Python X3D Package x3d.py
>    X3D Python Scene Access Interface Library (X3DPSAIL)
>    https://www.web3d.org/x3d/stylesheets/python/python.html
>
> * pip install x3d; Python package x3d
>    https://pypi.org/project/x3d
>
> Further improvement suggestions and bug reports welcome.  Hoping to complement other work, today's Design Printing Scanning demo was great - thanks very much.
>
> Have fun with X3D Python!
>
>
> On 4/23/2020 3:55 AM, Andreas Plesch wrote:
> > When I try this:
> >
> > inline=Inline(url=["Vent.x3d"])
> >
> > toXML() generates an error:
> >
> > inline.toXML()
> >
> > ---------------------------------------------------------------------------
> > TypeError                                 Traceback (most recent call last)
> > <ipython-input-26-2e0e2ed2e4db> in <module>
> > ----> 1 inline.toXML()
> >
> > ~/x3d.py in toXML(self, indentLevel)
> >    22341             result += " load='" + str(self.load) + "'"
> >    22342         if self.url != list():
> >> 22343             result += " url='" + self.url + "'"
> >    22344         if self.visible != True:
> >    22345             result += " visible='" + str(self.visible) + "'"
> >
> > TypeError: can only concatenate str (not "list") to str
> >
> > This is the x3d.py linked from the web3d web page.
> >
> > Do I need to do something different?
> >
> > -Andreas
> >
>
> 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



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list