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(y, z)
float_f()
int_f()
str_f()
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

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

Hook method for setting up the test fixture before exercising it.

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