import x3d
x3d package loaded, have fun with X3D Graphics!
x3dDoc = x3d.X3D()
scene = x3d.Scene()
x3dDoc.scene = scene
x3dDoc.toXML()
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-9f1a56a1770f> in <module> ----> 1 x3dDoc.toXML() ~/x3d.py in toXML(self, indentLevel) 6415 result += self.X3D_XML_SCHEMA_ATTRIBUTES_4_1 6416 result += '>' + '\n' # finish open tag -> 6417 if self.head.hasChild(): 6418 result += str(self.head.toXML(indentLevel=indentLevel+1)) 6419 if self.Scene.hasChild(): AttributeError: 'NoneType' object has no attribute 'hasChild'
scene.children
[]
Shape = x3d.Shape()
Shape
<x3d.Shape at 0x7ff23a64b198>
scene.children = [Shape]
scene.children
[<x3d.Shape at 0x7ff23a64b198>]
scene.toXML()
'<Scene>\n <Shape/>\n</Scene>\n'
x3dDoc.toXML()
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-13-9f1a56a1770f> in <module> ----> 1 x3dDoc.toXML() ~/x3d.py in toXML(self, indentLevel) 6415 result += self.X3D_XML_SCHEMA_ATTRIBUTES_4_1 6416 result += '>' + '\n' # finish open tag -> 6417 if self.head.hasChild(): 6418 result += str(self.head.toXML(indentLevel=indentLevel+1)) 6419 if self.Scene.hasChild(): AttributeError: 'NoneType' object has no attribute 'hasChild'