本文整理汇总了Python中collada.E.format方法的典型用法代码示例。如果您正苦于以下问题:Python E.format方法的具体用法?Python E.format怎么用?Python E.format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collada.E
的用法示例。
在下文中一共展示了E.format方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import format [as 别名]
def __init__(self, id, img, format=None, xmlnode=None):
"""Creates a surface.
:param str id:
A string identifier for the surface within the local scope of the material
:param collada.material.CImage img:
The image object
:param str format:
The format of the image
:param xmlnode:
If loaded from xml, the xml node
"""
self.id = id
"""The string identifier for the surface within the local scope of the material"""
self.image = img
""":class:`collada.material.CImage` object from the image library."""
self.format = format if format is not None else "A8R8G8B8"
"""Format string."""
if xmlnode != None:
self.xmlnode = xmlnode
"""ElementTree representation of the surface."""
else:
self.xmlnode = E.newparam(
E.surface(
E.init_from(self.image.id),
E.format(self.format)
, type="2D")
, sid=self.id)
示例2: save
# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import format [as 别名]
def save(self):
"""Saves the surface data back to :attr:`xmlnode`"""
surfacenode = self.xmlnode.find( tag('surface') )
initnode = surfacenode.find( tag('init_from') )
if self.format:
formatnode = surfacenode.find( tag('format') )
if formatnode is None:
surfacenode.append(E.format(self.format))
else:
formatnode.text = self.format
initnode.text = self.image.id
self.xmlnode.set('sid', self.id)