loader Package

loaderEgg Module

class pi3d.loader.loaderEgg.vertex(coords_in, UVcoords_in, normal_in)[source]

Bases: object

class pi3d.loader.loaderEgg.polygon(normal_in, rgba_in, MRef_in, TRef_in, vertexRef_in, vpkey_in)[source]

Bases: object

pi3d.loader.loaderEgg.loadFileEGG(model, fileName)[source]

Loads an panda3d egg file to produce Buffer object as part of a Shape.

Arguments:
model
Model object to add to.
fileName
Path and name of egg file relative to program file.

loaderObj Module

pi3d.loader.loaderObj.parse_vertex(text)[source]

Parse text chunk specifying single vertex.

Possible formats: * vertex index * vertex index / texture index * vertex index / texture index / normal index * vertex index / / normal index

pi3d.loader.loaderObj.loadFileOBJ(model, fileName)[source]

Loads an obj file with associated mtl file to produce Buffer object as part of a Shape. Arguments:

model
Model object to add to.
fileName
Path and name of obj file relative to program file.

parse_mtl Module

class pi3d.loader.parse_mtl.Materials[source]

Bases: object

NEW_MATERIAL_CHUNK = 'newmtl'
float3_f(x, y, z)
float_f(x)
int_f(x)
str_f(x)
class Prop(name, func)

Bases: tuple

Create new instance of Prop(name, func)

func

Alias for field number 1

name

Alias for field number 0

Materials.PROPERTIES = {'Kd': Prop(name='colorDiffuse', func=<function Materials.<lambda>>), 'map_Kd': Prop(name='mapDiffuse', func=<function Materials.<lambda>>), 'd': Prop(name='transparency', func=<function Materials.<lambda>>), 'Ns': Prop(name='specularCoef', func=<function Materials.<lambda>>), 'bump': Prop(name='mapBump', func=<function Materials.<lambda>>), 'map_d': Prop(name='mapAlpha', func=<function Materials.<lambda>>), 'map_Bump': Prop(name='mapBump', func=<function Materials.<lambda>>), 'illum': Prop(name='illumination', func=<function Materials.<lambda>>), 'map_Ks': Prop(name='mapSpecular', func=<function Materials.<lambda>>), 'Ks': Prop(name='colorSpecular', func=<function Materials.<lambda>>), 'Ni': Prop(name='opticalDensity', func=<function Materials.<lambda>>), 'Tf': Prop(name='colorTransparency', func=<function Materials.<lambda>>), 'Ka': Prop(name='colorAmbient', func=<function Materials.<lambda>>), 'map_Ka': Prop(name='mapAmbient', func=<function Materials.<lambda>>), 'Ke': Prop(name='colorEmissive', func=<function Materials.<lambda>>), 'Tr': Prop(name='transparency', func=<function Materials.<lambda>>)}
Materials.parse_lines(lines)[source]
Materials.parse_line(line)[source]
Materials.set_identifier(args, line)[source]
Materials.set_property(name, args)[source]
pi3d.loader.parse_mtl.parse_mtl(lines)[source]

Parse MTL file.

parse_mtl_test Module

class pi3d.loader.parse_mtl_test.ParseMtlTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]
test_cow()[source]
test_teapot()[source]