Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created August 18, 2015 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/1a7d6800559f9ee902f8 to your computer and use it in GitHub Desktop.
Save zeffii/1a7d6800559f9ee902f8 to your computer and use it in GitHub Desktop.
import bpy
# default 80 faces, all Tris
obj = bpy.data.objects['Icosphere']
# note the range is 80 * 3
flattened_list = []
[flattened_list.extend([0.5, 0.3, 0.7]) for i in range(80*3)]
obj.data.vertex_colors[0].data.foreach_set("color", flattened_list)
obj.data.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment