hello,
could anyone explain why this doesnt work? Ive tried it with blender 2.42a and a cvs build from 29/1
the output from running the script twice is included.
import Blender
from Blender import Scene
from Blender import NMesh
from Blender import Image
print
print "start"
def doObj(obj):
if obj.getType() != 'Mesh':
return
data = obj.getData()
lightmap_name = "lightmap_%s" % obj.name
try:
image = Image.Get(lightmap_name)
except NameError:
image = Image.New(lightmap_name, 512, 512, 24)
for face in data.faces:
print "was", face.image
face.image = image
print "now", face.image
def doScene(scene):
for obj in scene.getChildren():
doObj(obj)
scene = Scene.GetCurrent()
doScene(scene)
##########################
# first run
start
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
#second run
start
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]
was None
now [Image "lightmap_Cube"]