当前位置: 首页>>代码示例>>Python>>正文


Python E.vertices方法代码示例

本文整理汇总了Python中collada.E.vertices方法的典型用法代码示例。如果您正苦于以下问题:Python E.vertices方法的具体用法?Python E.vertices怎么用?Python E.vertices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在collada.E的用法示例。


在下文中一共展示了E.vertices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import vertices [as 别名]
    def __init__(self, collada, id, name, sourcebyid, primitives=None, xmlnode=None, double_sided=False):
        """Create a geometry instance

          :param collada.Collada collada:
            The collada object this geometry belongs to
          :param str id:
            A unique string identifier for the geometry
          :param str name:
            A text string naming the geometry
          :param sourcebyid:
            A list of :class:`collada.source.Source` objects or
            a dictionary mapping source ids to the actual objects
          :param list primitives:
            List of primitive objects contained within the geometry.
            Do not set this argument manually. Instead, create a
            :class:`collada.geometry.Geometry` first and then append
            to :attr:`primitives` with the `create*` functions.
          :param xmlnode:
            When loaded, the xmlnode it comes from.
          :param bool double_sided:
            Whether or not the geometry should be rendered double sided

        """
        self.collada = collada
        """The :class:`collada.Collada` object this geometry belongs to"""

        self.id = id
        """The unique string identifier for the geometry"""

        self.name = name
        """The text string naming the geometry"""

        self.double_sided = double_sided
        """A boolean indicating whether or not the geometry should be rendered double sided"""

        self.sourceById = sourcebyid
        """A dictionary containing :class:`collada.source.Source` objects indexed by their id."""

        if type(sourcebyid) is types.ListType:
            self.sourceById = {}
            for src in sourcebyid:
                self.sourceById[src.id] = src

        self.primitives = []
        """List of primitives (base type :class:`collada.primitive.Primitive`) inside this geometry."""
        if primitives is not None:
            self.primitives = primitives

        if xmlnode != None:
            self.xmlnode = xmlnode
            """ElementTree representation of the geometry."""
        else:
            sourcenodes = []
            verticesnode = None
            for srcid, src in self.sourceById.iteritems():
                sourcenodes.append(src.xmlnode)
                if verticesnode is None:
                    # pick first source to be in the useless <vertices> tag
                    verticesnode = E.vertices(
                        E.input(semantic="POSITION", source="#%s" % srcid), id=srcid + "-vertices"
                    )
            meshnode = E.mesh(*sourcenodes)
            meshnode.append(verticesnode)
            self.xmlnode = E.geometry(meshnode)
            if len(self.id) > 0:
                self.xmlnode.set("id", self.id)
            if len(self.name) > 0:
                self.xmlnode.set("name", self.name)
开发者ID:rehno-lindeque,项目名称:pycollada,代码行数:70,代码来源:geometry.py


注:本文中的collada.E.vertices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。