Skip to content
Browse files

Updated license headers and updated documentation

  • Loading branch information...
1 parent 5ba976d commit f3ede73fe5f10a201aa6e787daf9f42ae5c1fda9 @jterrace jterrace committed
View
8 AUTHORS
@@ -1,5 +1,5 @@
Ordered by date of first contribution:
- Alejandro Conty Estevez (aconty AT gmail.com)
- Conrad Wong
- Jeff Terrace (jterrace AT gmail.com)
- Rehno Lindeque
+ Alejandro Conty Estevez (aconty AT gmail.com)
+ Conrad Wong
+ Jeff Terrace (jterrace AT gmail.com)
+ Rehno Lindeque
View
5 COPYING
@@ -1,4 +1,9 @@
+pycollada 0.2 and above
+=======================
Copyright (c) 2011, Jeff Terrace and contributors
+
+pycollada 0.1
+=======================
Copyright (c) 2009, Scopia Visual Interfaces Systems
Redistribution and use in source and binary forms, with or without
View
211 collada/__init__.py
@@ -1,16 +1,16 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
-"""Main module for collada (PyCollada) package.
+"""Main module for collada (pycollada) package.
You will find here class `Collada` which is the one to use to access
collada file, and some exceptions that are raised in case the input
@@ -35,13 +35,15 @@ def tag( text ):
return str(ElementTree.QName( 'http://www.collada.org/2005/11/COLLADASchema', text ))
class DaeObject(object):
- """This class is the interface to all DAE objects loaded from a file.
+ """This class is the abstract interface to all collada objects.
Every <tag> in a COLLADA that we recognize and load has mirror
- class deriving from this one. It can be load() and save() according
- to methods defined here. All instances will have at least an attribute
- called "xmlnode" with the ElementTree representation of the data. Even if
- it was created on the fly.
+ class deriving from this one. All instances will have at least
+ a :meth:`load` method which creates the object from an xml node and
+ an attribute called :attr:`xmlnode` with the ElementTree representation
+ of the data. Even if it was created on the fly. If the object is
+ not read-only, it will also have a :meth:`save` method which saves the
+ object's information back to the :attr:`xmlnode` attribute.
"""
@@ -104,85 +106,100 @@ class DaeUnsupportedError(DaeError):
from util import IndexedList
class Collada(object):
- """Class used to access collada (dae,zae,kmz) files.
-
- It is able to load scenes from a file and access the supported
- data in an easy way. Supports plain xml DAE files or zip compressed
- structures like zae or kmz.
-
- """
+ """This is the main class used to create and load collada documents"""
def __init__(self, filename, ignore = [], aux_file_loader = None):
+ """Load collada data from filename or file like object.
+
+ :Parameters:
+ filename
+ String containing path to filename to open or file-like object.
+ Uncompressed .dae files are supported, as well as zip file archives.
+ ignore
+ A list of :class:`collada.DaeError` types that should be ignored
+ when loading the collada document. Instances of these types will
+ be added to :attr:`errors` after loading but won't be raised.
+ aux_file_loader
+ Referenced files (e.g. texture images) are loaded from disk when
+ reading from the local filesystem and from the zip archive when
+ loading from a zip file. If you these files are coming from another
+ source (e.g. database) and you're loading with StringIO, set this to
+ a function that given a filename, returns the binary data in the file.
+ """
+
+ self.errors = []
+ """List of :class:`collada.DaeError` objects representing errors encounterd while loading collada file"""
+ self.assetInfo = {}
+ """A dictionary structure that stores asset information coming from <asset> tag"""
+ self.geometries = IndexedList([], ('id',))
+ """A list of :class:`collada.geometry.Geometry` objects. Can also be indexed by id"""
+ self.controllers = IndexedList([], ('id',))
+ """A list of :class:`collada.controller.Controller` objects. Can also be indexed by id"""
+ self.lights = IndexedList([], ('id',))
+ """A list of :class:`collada.light.Light` objects. Can also be indexed by id"""
+ self.cameras = IndexedList([], ('id',))
+ """A list of :class:`collada.camera.Camera` objects. Can also be indexed by id"""
+ self.images = IndexedList([], ('id',))
+ """A list of :class:`collada.material.CImage` objects. Can also be indexed by id"""
+ self.effects = IndexedList([], ('id',))
+ """A list of :class:`collada.material.Effect` objects. Can also be indexed by id"""
+ self.materials = IndexedList([], ('id',))
+ """A list of :class:`collada.material.Effect` objects. Can also be indexed by id"""
+ self.nodes = IndexedList([], ('id',))
+ """A list of :class:`collada.scene.Node` objects. Can also be indexed by id"""
+ self.scenes = IndexedList([], ('id',))
+ """A list of :class:`collada.scene.Scene` objects. Can also be indexed by id"""
+
+ self.maskedErrors = []
+ self.ignoreErrors( *ignore )
+
+ if type(filename) in [types.StringType, types.UnicodeType]:
+ fdata = open(filename, 'rb')
+ else:
+ fdata = filename # assume it is a file like object
+ strdata = fdata.read()
+
try:
- """Load collada data from filename or file like object."""
- if type(filename) in [types.StringType, types.UnicodeType]:
- fdata = open(filename, 'rb')
- else:
- fdata = filename # assume it is a file like object
- strdata = fdata.read()
-
- try:
- self.zfile = zipfile.ZipFile(StringIO(strdata), 'r')
- except:
- self.zfile = None
-
- if self.zfile:
- self.filename = ''
- daefiles = []
- for name in self.zfile.namelist():
- if name.upper().endswith('.DAE'):
- daefiles.append(name)
- for name in daefiles:
- if not self.filename:
- self.filename = name
- elif "MACOSX" in self.filename:
- self.filename = name
- if not self.filename: raise DaeIncompleteError('No DAE found inside zip compressed file')
- data = self.zfile.read(self.filename)
- self.getFileData = self.getFileFromZip
- else:
- data = strdata
- self.filename = filename
- self.getFileData = self.getFileFromDisk
-
- if aux_file_loader is not None:
- self.getFileData = aux_file_loader
-
- self.errors = []
- self.maskedErrors = []
- self.ignoreErrors( *ignore )
- self.root = ElementTree.ElementTree(element=None, file=StringIO(data),
- parser=ElementTree.XMLParser(remove_comments=True))
-
- self.assetInfo = {}
- self.geometries = IndexedList([], ('id',))
- self.controllers = IndexedList([], ('id',))
- self.lights = IndexedList([], ('id',))
- self.cameras = IndexedList([], ('id',))
- self.images = IndexedList([], ('id',))
- self.effects = IndexedList([], ('id',))
- self.materials = IndexedList([], ('id',))
- self.nodes = IndexedList([], ('id',))
- self.scenes = IndexedList([], ('id',))
-
- self.validate()
- self.loadAssetInfo()
- self.loadImages()
- self.loadEffects()
- self.loadMaterials()
- self.loadGeometry()
- self.loadControllers()
- self.loadLights()
- self.loadCameras()
- self.loadNodes()
- self.loadScenes()
- self.loadDefaultScene()
+ self.zfile = zipfile.ZipFile(StringIO(strdata), 'r')
except:
- raise
-
- def validate(self):
- """TODO: Validate the xml tree."""
- pass
+ self.zfile = None
+
+ if self.zfile:
+ self.filename = ''
+ daefiles = []
+ for name in self.zfile.namelist():
+ if name.upper().endswith('.DAE'):
+ daefiles.append(name)
+ for name in daefiles:
+ if not self.filename:
+ self.filename = name
+ elif "MACOSX" in self.filename:
+ self.filename = name
+ if not self.filename: raise DaeIncompleteError('No DAE found inside zip compressed file')
+ data = self.zfile.read(self.filename)
+ self.getFileData = self._getFileFromZip
+ else:
+ data = strdata
+ self.filename = filename
+ self.getFileData = self._getFileFromDisk
+
+ if aux_file_loader is not None:
+ self.getFileData = aux_file_loader
+
+ self.root = ElementTree.ElementTree(element=None, file=StringIO(data),
+ parser=ElementTree.XMLParser(remove_comments=True))
+
+ self._loadAssetInfo()
+ self._loadImages()
+ self._loadEffects()
+ self._loadMaterials()
+ self._loadGeometry()
+ self._loadControllers()
+ self._loadLights()
+ self._loadCameras()
+ self._loadNodes()
+ self._loadScenes()
+ self._loadDefaultScene()
def handleError(self, error):
self.errors.append(error)
@@ -202,7 +219,7 @@ def ignoreErrors(self, *args):
else:
for e in args: self.maskedErrors.append(e)
- def getFileFromZip(self, fname):
+ def _getFileFromZip(self, fname):
"""Return the binary data of an auxiliary file from a zip archive as a string."""
if not self.zfile:
raise DaeBrokenRefError('Trying to load an auxiliar file %s but we are not reading from a zip'%fname)
@@ -212,7 +229,7 @@ def getFileFromZip(self, fname):
raise DaeBrokenRefError('Auxiliar file %s not found in archive'%fname)
return self.zfile.read( aux_path )
- def getFileFromDisk(self, fname):
+ def _getFileFromDisk(self, fname):
"""Return the binary data of an auxiliary file from the local disk relative to the file path loaded."""
if self.zfile:
raise DaeBrokenRefError('Trying to load an auxiliar file %s from disk but we are reading from a zip file'%fname)
@@ -223,7 +240,7 @@ def getFileFromDisk(self, fname):
fdata = open(aux_path, 'rb')
return fdata.read()
- def loadAssetInfo(self):
+ def _loadAssetInfo(self):
"""Load information in <asset> tag"""
assetnode = self.root.find( tag('asset') )
if assetnode != None:
@@ -266,7 +283,7 @@ def loadAssetInfo(self):
if not 'up_axis' in self.assetInfo:
self.assetInfo['up_axis'] = 'Y_UP'
- def loadGeometry(self):
+ def _loadGeometry(self):
"""Load geometry library."""
libnode = self.root.find( tag('library_geometries') )
if libnode != None:
@@ -277,7 +294,7 @@ def loadGeometry(self):
else:
self.geometries.append( G )
- def loadControllers(self):
+ def _loadControllers(self):
"""Load controller library."""
libnode = self.root.find( tag('library_controllers') )
if libnode != None:
@@ -289,7 +306,7 @@ def loadControllers(self):
else:
self.controllers.append( C )
- def loadLights(self):
+ def _loadLights(self):
"""Load light library."""
libnode = self.root.find( tag('library_lights') )
if libnode != None:
@@ -299,7 +316,7 @@ def loadLights(self):
else:
self.lights.append( lig )
- def loadCameras(self):
+ def _loadCameras(self):
"""Load camera library."""
libnode = self.root.find( tag('library_cameras') )
if libnode != None:
@@ -309,7 +326,7 @@ def loadCameras(self):
else:
self.cameras.append( cam )
- def loadImages(self):
+ def _loadImages(self):
"""Load image library."""
libnode = self.root.find( tag('library_images') )
if libnode != None:
@@ -319,7 +336,7 @@ def loadImages(self):
else:
self.images.append( img )
- def loadEffects(self):
+ def _loadEffects(self):
"""Load effect library."""
libnode = self.root.find( tag('library_effects') )
if libnode != None:
@@ -329,7 +346,7 @@ def loadEffects(self):
else:
self.effects.append( effect )
- def loadMaterials(self):
+ def _loadMaterials(self):
"""Load material library.
Materials are only treated as aliases for effects at the time.
@@ -365,7 +382,7 @@ def loadMaterials(self):
self.materials.append( mateffect )
except DaeError, ex: self.handleError(ex)
- def loadNodes(self):
+ def _loadNodes(self):
libnode = self.root.find( tag('library_nodes') )
if libnode != None:
for node in libnode.findall(tag('node')):
@@ -375,7 +392,7 @@ def loadNodes(self):
if N is not None:
self.nodes.append( N )
- def loadScenes(self):
+ def _loadScenes(self):
"""Load scene library."""
libnode = self.root.find( tag('library_visual_scenes') )
if libnode != None:
@@ -385,7 +402,7 @@ def loadScenes(self):
else:
self.scenes.append( S )
- def loadDefaultScene(self):
+ def _loadDefaultScene(self):
"""Loads the default scene from <scene> tag in the root node."""
node = self.root.find('%s/%s'%( tag('scene'), tag('instance_visual_scene') ) )
self.scene = None
View
12 collada/__main__.py
@@ -1,3 +1,15 @@
+####################################################################
+# #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
+# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
+# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
+# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
+# #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
+# #
+####################################################################
+
import unittest2
if __name__ == '__main__':
View
50 collada/camera.py
@@ -1,16 +1,16 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
-"""Camera module, class and tools."""
+"""Contains objects for representing cameras"""
from lxml import etree as ElementTree
import numpy
@@ -27,13 +27,13 @@ def __init__(self, id, fov, near, far, xmlnode = None):
id
Id for the object
fov
- Y axis field of visiona in degrees
+ Y axis field of vision in degrees
near
Near plane distance
far
Far plane distance
xmlnode
- If load form xml, the xml node
+ If loaded from xml, the xml node
"""
self.id = id
@@ -44,12 +44,6 @@ def __init__(self, id, fov, near, far, xmlnode = None):
"""Near plane distance."""
self.far = far
"""Far plane distance."""
- self.position = numpy.array( [0, 0, 0], dtype=numpy.float32 )
- """Position in space of the point of view."""
- self.direction = numpy.array( [0, 0, -1], dtype=numpy.float32 )
- """Look direction of the camera."""
- self.up = numpy.array( [0, 1, 0], dtype=numpy.float32 )
- """Up vector of the camera."""
if xmlnode != None: self.xmlnode = xmlnode
else:
self.xmlnode = E.camera(
@@ -65,6 +59,7 @@ def __init__(self, id, fov, near, far, xmlnode = None):
, id=self.id, name=self.id)
def save(self):
+ """Saves the camera's properties back to xmlnode"""
self.xmlnode.set('id', self.id)
self.xmlnode.set('name', self.id)
persnode = self.xmlnode.find( '%s/%s/%s'%(tag('optics'),tag('technique_common'),
@@ -109,7 +104,6 @@ def load(collada, localscope, node):
else: far = None
except ValueError, ex:
raise DaeMalformedError('Corrupted float values in camera definition')
- # KISS
for n in persnode:
if n.tag in ['xfov', 'aspect_ratio']: persnode.remove(n)
if yfovnode is None:
@@ -119,32 +113,32 @@ def load(collada, localscope, node):
return Camera(node.get('id'), fov, near, far, xmlnode = node)
def bind(self, matrix):
- """Create a bound camera of itself based on a transform matrix."""
+ """Create a bound camera of itself based on a transform matrix.
+
+ :Parameters:
+ matrix
+ A numpy transformation matrix of size 4x4
+ :Returns:
+ A :class:`collada.camera.BoundCamera`
+ """
return BoundCamera(self, matrix)
+ def __str__(self): return 'Camera id=%s' % self.id
+ def __repr__(self): return str(self)
+
class BoundCamera(object):
- """Camera bound to a scene with a transform."""
+ """Camera bound to a scene with a transform. This gets created when a
+ camera is instantiated in a scene. Do not create this manually."""
def __init__(self, cam, matrix):
- """Create a bound camera based on a transform matrix."""
self.fov = cam.fov
"""Field of vision in degrees."""
self.near = cam.near
"""Near plane distance."""
self.far = cam.far
"""Far plane distance."""
- self.position = numpy.dot( matrix[:3,:3], cam.position ) + matrix[:3,3]
- """Position in space of the point of view."""
- self.direction = numpy.dot( matrix[:3,:3], cam.direction )
- """Look direction of the camera."""
- self.up = numpy.dot( matrix[:3,:3], cam.up )
- """Up vector of the camera."""
self.original = cam
- """Original camera object from this object is a transformation."""
- dlen = numpy.sqrt(numpy.dot(self.direction, self.direction))
- ulen = numpy.sqrt(numpy.dot(self.up, self.up))
- if dlen > 0: self.direction /= dlen
- if ulen > 0: self.up /= ulen
+ """Original :class:`collada.camera.Camera` object this is bound to."""
- def __str__(self): return 'Camera(at %s)' % str(self.position)
+ def __str__(self): return 'BoundCamera bound to %s' % self.original.id
def __repr__(self): return str(self)
View
6 collada/controller.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/geometry.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/light.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/lineset.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/material.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/polygons.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/polylist.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
16 collada/primitive.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
@@ -24,7 +24,7 @@ def __init__(self, offset, semantic, src, set=None):
self.source = src
self.set = set
- semantics = ["VERTEX", "NORMAL", "TEXCOORD", "TEXBINORMAL", "TEXTANGENT", "COLOR"]
+ semantics = ["VERTEX", "NORMAL", "TEXCOORD", "TEXBINORMAL", "TEXTANGENT", "COLOR", "TANGENT", "BINORMAL"]
def __init__(self):
self.inputs = {}
@@ -91,6 +91,8 @@ def getInputsFromList(localscope, inputs):
textangent_inputs = []
texbinormal_inputs = []
color_inputs = []
+ tangent_inputs = []
+ binormal_inputs = []
for input in inputs:
offset, semantic, source, set = input
@@ -111,6 +113,10 @@ def getInputsFromList(localscope, inputs):
texbinormal_inputs.append(input)
elif semantic == 'COLOR':
color_inputs.append(input)
+ elif semantic == 'TANGENT':
+ tangent_inputs.append(input)
+ elif semantic == 'BINORMAL':
+ binormal_inputs.append(input)
else:
raise DaeUnsupportedError('Unknown input semantic: %s' % semantic)
@@ -121,6 +127,8 @@ def getInputsFromList(localscope, inputs):
all_inputs['TEXBINORMAL'] = textangent_inputs
all_inputs['TEXTANGENT'] = textangent_inputs
all_inputs['COLOR'] = color_inputs
+ all_inputs['TANGENT'] = tangent_inputs
+ all_inputs['BINORMAL'] = binormal_inputs
return all_inputs
View
6 collada/scene.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/source.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
6 collada/triangleset.py
@@ -1,12 +1,12 @@
####################################################################
# #
-# THIS FILE IS PART OF THE PyCollada LIBRARY SOURCE CODE. #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
# #
-# THE PyCollada SOURCE CODE IS (C) COPYRIGHT 2009 #
-# by Scopia Visual Interfaces Systems http://www.scopia.es/ #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
# #
####################################################################
View
12 collada/util.py
@@ -1,3 +1,15 @@
+####################################################################
+# #
+# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #
+# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #
+# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
+# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. #
+# #
+# THE pycollada SOURCE CODE IS (C) COPYRIGHT 2011 #
+# by Jeff Terrace and contributors #
+# #
+####################################################################
+
import numpy
from collada import DaeMalformedError
View
2 docs/conf.py
@@ -192,3 +192,5 @@
# If false, no module index is generated.
#latex_use_modindex = True
+
+autoclass_content = 'both'
View
6 docs/index.rst
@@ -9,8 +9,10 @@ Welcome to pycollada's documentation!
Contents:
---------
-:doc:`api/index`
- The **pycollada** API documentation.
+.. toctree::
+ :maxdepth: 2
+
+ api/index
Indices and tables
==================
View
1 examples/recurse_check.py
@@ -86,7 +86,6 @@ def main():
assert(len(prim) >= 0)
for cam in col.scene.objects('camera'):
assert(cam.original.id)
- assert(len(cam.position) == 3)
except (KeyboardInterrupt, SystemExit):
print
sys.exit("Keyboard interrupt. Exiting.")

0 comments on commit f3ede73

Please sign in to comment.
Something went wrong with that request. Please try again.