Graphics Reference
In-Depth Information
obj.keyframe_insert(data_path="location",
frame=startframe,
index=2)
obj.location[2] = self.location[2] + self.bounce_height
obj.keyframe_insert(data_path="location",
frame=startframe+(10/self.speed),
index=2)
obj.location[2] = self.location[2]
obj.keyframe_insert(data_path="location",
frame=startframe+(20/self.speed),
index=2)
obj.animation_data.action.fcurves[0].modifiers.new('CYCLES')
class Bouncing_Cone(bpy.types.Operator, AddObjectHelper):
"""Add a bouncing colored cone"""
bl_idname = "object.bouncing_cone_add"
bl_label = "Bouncing Cone"
bl_description = "Add a bouncing cone"
bl_options = {'REGISTER', 'UNDO'}
scale = FloatVectorProperty(name='scale',
default=(1.0, 1.0, 1.0),
subtype='TRANSLATION',
description='scaling')
height = FloatProperty( attr='height',
name='Height', default = 1,
min = 0, soft_min = 0, max = 2,
description='Height of the cone')
radius = FloatProperty( attr='radius',
name='Radius', default = 0.5,
min = 0.001, soft_min = 0.001, max = 2,
description='Radius of the cone')
speed = FloatProperty( attr='speed',
name='Bounce speed', default = 1,
min = 0.5, soft_min = 00.5, max = 2,
description='Speed of the bouncing cone')
bounce_height = FloatProperty( attr='bounce_height',
name='Bounce height', default = 1,
min = 0, soft_min = 0, max = 2,
description='Height of the bouncing cone')
r = FloatProperty( attr='red',
name='Red', default = 0.5,
min = 0, soft_min = 0, max = 1,
description='Red')
Search WWH ::




Custom Search