/usr/lib/python2.7/dist-packages/collada/animation.py is in python-collada 0.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ####################################################################
# #
# 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 #
# #
####################################################################
"""Contains objects representing animations."""
from collada import source
from collada.common import DaeObject, tag
from collada.common import DaeIncompleteError, DaeBrokenRefError, \
DaeMalformedError, DaeUnsupportedError
class Animation(DaeObject):
"""Class for holding animation data coming from <animation> tags."""
def __init__(self, id, name, sourceById, children, xmlnode=None):
self.id = id
self.name = name
self.children = children
self.sourceById = sourceById
self.xmlnode = xmlnode
if self.xmlnode is None:
self.xmlnode = None
@staticmethod
def load( collada, localscope, node ):
id = node.get('id') or ''
name = node.get('name') or ''
sourcebyid = localscope
sources = []
sourcenodes = node.findall(tag('source'))
for sourcenode in sourcenodes:
ch = source.Source.load(collada, {}, sourcenode)
sources.append(ch)
sourcebyid[ch.id] = ch
child_nodes = node.findall(tag('animation'))
children = []
for child in child_nodes:
try:
child = Animation.load(collada, sourcebyid, child)
children.append(child)
except DaeError as ex:
collada.handleError(ex)
anim = Animation(id, name, sourcebyid, children, node)
return anim
def __str__(self): return '<Animation id=%s, children=%d>' % (self.id, len(self.children))
def __repr__(self): return str(self)
|