Graphics Reference
In-Depth Information
cone'smaterialintermsofred,blue,andgreenvalues.Allofthesevaluesareobjectsoftheclass
FloatProp-
erty
.
The
height
property variable is set like this:
height = FloatProperty( attr='height',
name='Height', default = 1,
min = 0, soft_min = 0, max = 2,
description='Height of the cone')
The minimum, maximum, and default values are set in this constructor, as well as the optional
soft_min
and
soft_max
, which determine the minimum and maximum values available through the graphical user in-
terface. The radius of the base is defined here:
radius = FloatProperty( attr='radius',
name='Radius', default = 0.5,
min = 0.001, soft_min = 0.001, max = 2,
description='Radius of the cone')
The speed of the bounces is determined with the
speed
variable, which is set to range from 0.5 to 2. This
willlaterbeusedasadenominatortosetthedistancebetweenkeyframes.Thedefinitionofthe
speed
variable
goes like this:
speed = FloatProperty( attr='speed',
name='Bounce speed', default = 1,
min = 0.5, soft_min = 00.5, max = 2,
description='Speed of the bouncing cone')
The
bounce_height
variable, similarly to
speed
, is used to determine the positioning of keyframes. Its
definition is as follows:
bounce_height = FloatProperty( attr='bounce_height',
name='Bounce height', default = 1,
min = 0, soft_min = 0, max = 2,
description='Height of the bouncing cone')
ThelastthreefloatpropertiesaretheRGBcolorvaluesthatwillbeassignedtothe3Dobject'smaterialcolor.
They range from 0 to 1, yielding a full range of possible color settings. We'll make a light-green material. The
definitions are as follows:
r = FloatProperty( attr='red',
name='Red', default = 0.5,
min = 0, soft_min = 0, max = 1,
description='Red')
g = FloatProperty( attr='green',
name='Green', default = 1,
min = 0, soft_min = 0, max = 1,
description='Green')
b = FloatProperty( attr='blue',
name='Blue', default = 0.5,
min = 0, soft_min = 0, max = 1,
description='Blue')