def render(): # update scene bpy.context.scene.update() # Enable ambient occlusion utils.setAmbientOcclusion(samples=30) # Render scene utils.renderToFolder('rendering', 'funky_cover', 8.5 * 300, 11 * 300)
constraint.track_axis = 'TRACK_Z' constraint.lock_axis = 'LOCK_Y' objects.append(obj) bpy.context.scene.update() return objects if __name__ == '__main__': # Remove all elements utils.removeAll() # Set ambient occlusion utils.setAmbientOcclusion() # Create camera and lamp targetObj, cameraObj, lampObj = utils.simpleScene((0, 0, 0), (6, 6, 3.5), (-5, 5, 10)) # Make target as parent of camera cameraObj.parent = targetObj # Set number of frames bpy.context.scene.frame_end = 50 # Animate rotation of target by keyframe animation targetObj.rotation_mode = 'AXIS_ANGLE' targetObj.rotation_axis_angle = (0, 0, 0, 1) targetObj.keyframe_insert(data_path='rotation_axis_angle',
matrix=T * M0 * M1 * Rot) return bm if __name__ == '__main__': # Remove all elements utils.removeAll() # Creata phyllotaxis flower blossom = PhyllotaxisFlower(bpy.context.scene) # Create camera and lamp utils.simpleScene((0, 0, -1.5), (-21.5, -21.5, 12.5), (-5, 5, 10)) # Enable ambient occlusion utils.setAmbientOcclusion(samples=10) # Select colors palette = [(3, 101, 100), (205, 179, 128)] # Convert color and apply gamma correction palette = [ tuple(pow(float(c) / 255, 2.2) for c in color) for color in palette ] # Set background color of scene bpy.context.scene.world.horizon_color = palette[0] # Set material for object mat = utils.falloffMaterial(palette[1]) blossom.obj.data.materials.append(mat)