本文整理汇总了Python中collada.E.instance_geometry方法的典型用法代码示例。如果您正苦于以下问题:Python E.instance_geometry方法的具体用法?Python E.instance_geometry怎么用?Python E.instance_geometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collada.E
的用法示例。
在下文中一共展示了E.instance_geometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import instance_geometry [as 别名]
def __init__(self, geometry, materials=None, xmlnode=None):
"""Creates a geometry node
:param collada.geometry.Geometry geometry:
A geometry to instantiate in the scene
:param list materials:
A list containing items of type :class:`collada.scene.MaterialNode`.
Each of these represents a material that the geometry should be
bound to.
:param xmlnode:
When loaded, the xmlnode it comes from
"""
self.geometry = geometry
"""An object of type :class:`collada.geometry.Geometry` representing the
geometry to bind in the scene"""
self.materials = []
"""A list containing items of type :class:`collada.scene.MaterialNode`.
Each of these represents a material that the geometry is bound to."""
if materials is not None:
self.materials = materials
if xmlnode != None:
self.xmlnode = xmlnode
"""ElementTree representation of the geometry node."""
else:
self.xmlnode = E.instance_geometry(url="#%s" % self.geometry.id)
if len(self.materials) > 0:
self.xmlnode.append(E.bind_material(
E.technique_common(
*[mat.xmlnode for mat in self.materials]
)
))