[Bf-committers] Getting pixel color for a vertex (the stupid way)

Hart's Antler bhartsho at yahoo.com
Wed Dec 15 08:19:53 CET 2010


Getting a UV texture's pixel value per vertex, the stupid way.
(this should be rewritten as a C function exposed to Python)
This script does the following hack to get the pixel value:
  1. copy the object
  2. apply a displace modifier
  3. for each RGB set the ImageTexture.<color>_factor to 1.0 and others to 0.0
  4. for each RGB bake a mesh (apply the displace modifier)
  5. for each RGB find the difference of vertex locations
  6. apply the differences as vertex colors

http://pastebin.com/FJWKSGBR

for some reason the values are off and always tinted green.





More information about the Bf-committers mailing list