On 15/05/2017 at 02:01, xxxxxxxx wrote:
I can't get the bake functino to work. I always got a black output. And There is no informations / exemples in the python sdk.
Moreover it would be nice to have in the sdk which option are needed in all cases(like BAKE_TEX_WIDTH, BAKE_TEX_HEIGHT).
illumBMP = c4d.bitmaps.BaseBitmap()
tmp = illumBMP.Init(512, 512, 24, 0)
#make sur to init a width/height
bc = c4d.BaseContainer()
bc[c4d.BAKE_TEX_COLOR] = True
bc[c4d.BAKE_TEX_COLOR_ILLUM] = True
bc[c4d.BAKE_TEX_NO_INIT_BITMAP] = True
bc[c4d.BAKE_TEX_WIDTH] = True
bc[c4d.BAKE_TEX_HEIGHT] = True
thread = c4d.threading.GeGetCurrentThread()
ibt = c4d.utils.InitBakeTexture(doc, targetTex, targetUVW, targetUVW, bc, thread)
#Check if something went wrong
if ibt[1] != c4d.BAKE_TEX_ERR_NONE:
print ibt
return
#Assign the new render doc
render_doc = ibt[0]
bt = c4d.utils.BakeTexture(render_doc, bc, illumBMP, thread, None)
#Check if something went wrong
if bt != c4d.BAKE_TEX_ERR_NONE:
print bt
return
#save our baked image to somewhere:
f_path = os.path.join(tempfile.gettempdir(),"realTimeIllumBake_buffer_picture.jpg")
illumBMP.Save(f_path, c4d.FILTER_JPG)
Thanks in advance (it's not very important it's just for myself, so take your time support guys ;))