Python RenderMan API Lego Figure
assignment Namespace Reference

Functions

def Cube (width=1.0, height=1.0, depth=1.0)
 Cube definition from Cube.py by Jon Macey (https://github.com/NCCA/Renderman/blob/master/Lecture1Intro/Cube.py). More...
 
def checkAndCompileShader (shader)
 Load OSL shader definition is from scene.py by Jon Macey (https://github.com/NCCA/Renderman/blob/master/Lecture4Shaders/scene.py). More...
 
def convertColourValue (colourValue)
 A funciton to convert a value of 0-255 to a value of 0-1. More...
 
def legsShader (legsColour, dirtValue, damage)
 A function for the definiton of the shader to use on the legs. More...
 
def headShader (headColour, dirtValue)
 A function for the definiton of the shader to use on the head. More...
 
def chestShader (chestType, chestBaseColour, chestDetailColour, dirtValue, damage)
 A function for the definiton of the shader to use on the chest. More...
 
def tableShader ()
 A function for the definiton of the shader to use on the table. More...
 
def head (xScale, yScale, zScale)
 A function for the definiton of the main head geometry (points generated in external modeling program). More...
 
def chest (xScale, yScale, zScale)
 A function for the definiton of the chest gemoetry (points generated in external modeling program). More...
 
def loadColourCmd (cmdNum, cmdNumType, defaultColour)
 A function for loading in a colour from the command line. More...
 
def drawScene (ri, chestType, chestBaseColour, chestDetailColour, headColour, legsColour, dirtValue, damage)
 A function for the definiton of the scene to generate. More...
 

Variables

bool altAngle = False
 The main function. More...
 
string outputType = "it"
 The type of output to use, default is it. More...
 
string chestType = "blank"
 Initalise the default values for the figure generation. More...
 
list chestBaseColour = [0.02,0.02,0.4]
 Check for chest base colour command. More...
 
list chestDetailColour = [1,1,1]
 Check for chest detail colour command. More...
 
list headColour = [convertColourValue(220),convertColourValue(150),convertColourValue(10)]
 Check for head colour command. More...
 
list legsColour = [0.6,0,0]
 Check for legs colour command. More...
 
float dirtValue = 0.3
 
bool customFileName = False
 Check for alt angle command. More...
 
int damage = 3
 
 loadedNum = float(sys.argv[i+1])
 Check for dirt value command. More...
 
 outputFilename = sys.argv[i+1]
 Set the filename based on angle. More...
 
 ri = prman.Ri()
 
string filename = outputFilename + ".rib"
 

Function Documentation

◆ checkAndCompileShader()

def assignment.checkAndCompileShader (   shader)

Load OSL shader definition is from scene.py by Jon Macey (https://github.com/NCCA/Renderman/blob/master/Lecture4Shaders/scene.py).

Parameters
shaderThe shader to load.

Definition at line 40 of file assignment.py.

◆ chest()

def assignment.chest (   xScale,
  yScale,
  zScale 
)

A function for the definiton of the chest gemoetry (points generated in external modeling program).

Parameters
xScaleThe scale of the chest in the X direction.
yScaleThe scale of the chest in the Y direction.
zScaleThe scale of the chest in the Z direction.

Definition at line 179 of file assignment.py.

Here is the caller graph for this function:

◆ chestShader()

def assignment.chestShader (   chestType,
  chestBaseColour,
  chestDetailColour,
  dirtValue,
  damage 
)

A function for the definiton of the shader to use on the chest.

Parameters
chestTypeThe type of chest pattern to generate (blank, checked, perlin or camo).
chestBaseColourThe base colour for the chest.
chestDetailColourThe deatil colour for the chest.
dirtValueThe amount of dirt to add to the chest.
damageThe seed of the damage to add to the chest.

Definition at line 109 of file assignment.py.

Here is the caller graph for this function:

◆ convertColourValue()

def assignment.convertColourValue (   colourValue)

A funciton to convert a value of 0-255 to a value of 0-1.

Parameters
colourValueThe colour value to convert.

Definition at line 50 of file assignment.py.

Here is the caller graph for this function:

◆ Cube()

def assignment.Cube (   width = 1.0,
  height = 1.0,
  depth = 1.0 
)

Cube definition from Cube.py by Jon Macey (https://github.com/NCCA/Renderman/blob/master/Lecture1Intro/Cube.py).

Parameters
widthThe width of the cube (Default value of 1.0).
heightThe height of the cube (Default value of 1.0).
depthThe depth of the cube (Default value of 1.0).

Definition at line 13 of file assignment.py.

Here is the caller graph for this function:

◆ drawScene()

def assignment.drawScene (   ri,
  chestType,
  chestBaseColour,
  chestDetailColour,
  headColour,
  legsColour,
  dirtValue,
  damage 
)

A function for the definiton of the scene to generate.

Parameters
riThe Renderman instance.
chestTypeThe type of chest pattern to generate (blank, checked, perlin or camo).
chestBaseColourThe base colour for the chest.
chestDetailColourThe deatil colour for the chest.
headColourThe colour for the head.
legsColourThe colour for the legs.
dirtValueThe amount of dirt to add to the chest.
damageThe seed of the damage to add to the chest.

Definition at line 239 of file assignment.py.

Here is the call graph for this function:

◆ head()

def assignment.head (   xScale,
  yScale,
  zScale 
)

A function for the definiton of the main head geometry (points generated in external modeling program).

Parameters
xScaleThe scale of the head in the X direction.
yScaleThe scale of the head in the Y direction.
zScaleThe scale of the head in the Z direction.

Definition at line 156 of file assignment.py.

Here is the caller graph for this function:

◆ headShader()

def assignment.headShader (   headColour,
  dirtValue 
)

A function for the definiton of the shader to use on the head.

Parameters
headColourThe colour for the head.
dirtValueThe amount of dirt to add to the head.

Definition at line 87 of file assignment.py.

Here is the caller graph for this function:

◆ legsShader()

def assignment.legsShader (   legsColour,
  dirtValue,
  damage 
)

A function for the definiton of the shader to use on the legs.

Parameters
legsColourThe colour for the legs.
dirtValueThe amount of dirt to add to the legs.
damageThe seed of the damage to add to the legs.

Definition at line 57 of file assignment.py.

Here is the caller graph for this function:

◆ loadColourCmd()

def assignment.loadColourCmd (   cmdNum,
  cmdNumType,
  defaultColour 
)

A function for loading in a colour from the command line.

Parameters
cmdNumThe command for the number value.
cmdNumTypeThe command for the type of number value.
defaultColourThe default colour to use if the command is invalid.

Definition at line 203 of file assignment.py.

Here is the call graph for this function:

◆ tableShader()

def assignment.tableShader ( )

A function for the definiton of the shader to use on the table.

Definition at line 139 of file assignment.py.

Here is the caller graph for this function:

Variable Documentation

◆ altAngle

bool assignment.altAngle = False

The main function.

Check for alt angle command.

A boolean for the angle to generate.

Set the alt angle to be true.

Definition at line 377 of file assignment.py.

◆ chestBaseColour

def assignment.chestBaseColour = [0.02,0.02,0.4]

Check for chest base colour command.

Load the colour from the command.

Definition at line 383 of file assignment.py.

◆ chestDetailColour

def assignment.chestDetailColour = [1,1,1]

Check for chest detail colour command.

Load the colour from the command.

Definition at line 384 of file assignment.py.

◆ chestType

assignment.chestType = "blank"

Initalise the default values for the figure generation.

Check command line inputs.

Check for chest type command. Check if valid chest type.

Definition at line 382 of file assignment.py.

◆ customFileName

bool assignment.customFileName = False

Check for alt angle command.

Set the code to use a custom filename.

Definition at line 388 of file assignment.py.

◆ damage

assignment.damage = 3

Definition at line 389 of file assignment.py.

◆ dirtValue

assignment.dirtValue = 0.3

Definition at line 387 of file assignment.py.

◆ filename

string assignment.filename = outputFilename + ".rib"

Definition at line 491 of file assignment.py.

◆ headColour

def assignment.headColour = [convertColourValue(220),convertColourValue(150),convertColourValue(10)]

Check for head colour command.

Load the colour from the command.

Definition at line 385 of file assignment.py.

◆ legsColour

def assignment.legsColour = [0.6,0,0]

Check for legs colour command.

Load the colour from the command.

Definition at line 386 of file assignment.py.

◆ loadedNum

assignment.loadedNum = float(sys.argv[i+1])

Check for dirt value command.

Check for damage value command.

Try to convert to numbers.

Definition at line 451 of file assignment.py.

◆ outputFilename

string assignment.outputFilename = sys.argv[i+1]

Set the filename based on angle.

Definition at line 465 of file assignment.py.

◆ outputType

assignment.outputType = "it"

The type of output to use, default is it.

Check for output command.

Check if valid output type.

Definition at line 379 of file assignment.py.

◆ ri

assignment.ri = prman.Ri()

Definition at line 482 of file assignment.py.