Notifications
Clear all

[Closed] bake with vray problems

hi:
i have a broblem ,with bake objs. using vray renderer .

i have code to bake objs with default scanline render , it works fine . the script is:
loop all the objs and add unwrap uvw modifier to them , then flatten it , render the bake map using command :
render rendertype:#bakeselected
when i change the renderer to vray . problem comes .vray crashed ,and at same time , max crashed . i dont know why .

does anyone have idea about bake script using vray ?

i know vray has a bake function . but now we use the old max bake function . all the code running good with scanline render .

thanks for help .
and welcome anybody add me to ur google talk or msn buddy list .


dear prettypixel , if u online . and have time , contect me pls . my mail : http://forums.cgsociety.org/haibo.lan@gmail.co m” data-bbcode=”true”>haibo.lan@gmail.com msn: http://forums.cgsociety.org/ehblan@hotmail.co m” data-bbcode=”true”>ehblan@hotmail.com . thanks . we have chated with bake render before . and i m waiting for u. man .

2 Replies

codes here ,for the script run good with scanline and mentalray renderer , but crash when use vray . i dont know why , maybe some switchs of vary has not found . wish anybody show me the key . thanks .

rollout bakevray "bake vray" 
(

-- interface define -- 
spinner uvwspacing "uvw spacing" range:[0,100,0.003]  type:#float 
button normalBake "normal bake" 
-- fn define ------------
fn selectobjs_bakevray = 
(
local theR = for i in selection where i.material != undefined collect i 
return theR 
)
----------------------------
fn addUVW obj theMapChannel:1 theName:"hb_UVW"= -- this fn has interface value >> uvwspacing.
 (
  local unwrapMod = unwrap_UVW()
   
  unwrapMod.setAlwaysEdit  off
  unwrapMod.setMapChannel  theMapChannel
  unwrapMod.setFlattenAngle   45.0
  unwrapMod.setFlattenSpacing uvwspacing.value -- interface value .uvwspacing . 
  unwrapMod.setFlattenNormalize on
  unwrapMod.setFlattenRotate  on
  unwrapMod.setFlattenFillHoles on
  unwrapMod.setApplyToWholeObject on
  unwrapMod.name = theName 
  addmodifier obj unwrapMod 
  obj.modifiers[1].setViewportOpenEdges off
  obj.modifiers[1].flattenMap 45.0 #([1,0,0],[-1,0,0], [0,1,0],[0,-1,0], [0,0,1],[0,0,-1]) uvwspacing.value true 0 true true -- interface value. uvwspacing.
 )
----------------------------
fn completeMapElement theFileType:".jpg" cmSize:512 =
 (
  bakeC=completeMap()
  bakeC.enabled=on 
  bakeC.outputSzX=bakeC.outputSzY=cmSize--element size . && mapSize of bakeRender 
  bakeC.fileType= theFileType
  bakeC.shadowsOn=on
  return bakeC 
 )
-----------------------------
fn addElement obj theElement theChannel:3 thePadding:16=
 (
  obj.InodeBakeproperties.addBakeElement theElement
  obj.InodeBakeproperties.bakeEnabled=on
  obj.InodeBakeproperties.bakeChannel=theChannel
  obj.InodeBakeproperties.nDilations=thePadding
  return obj
 ) 
----------------------------

fn bakeRender obj  MapSize:512 = 
 (
 select obj
local  renderBitMap=undefined 
 RenderBitmap=bitmap (mapSize) (mapSize)

render renderType:#bakeSelected  vfb:on to:renderBitMap -- renderer:#current quiet:on 
close renderBitMap
 )

---actions --------------
on normalBake pressed do 
(
local objs = selectobjs_bakevray()
-- convert to poly first and add unwrap uvw modifier-- 
for i in objs do (convertto i editable_poly ; adduvw i theMapchannel:3)
-- bake loop -- 
for i in objs do 
 (
 addElement i (completeMapElement theFileType:("d:\\"+i.name+".jpg")) -- or dds --(theDir+(objs[i].name)+theFileTypeLan)
 --i.modifiers[1].flattenMap 45.0 #([1,0,0],[-1,0,0], [0,1,0],[0,-1,0], [0,0,1],[0,0,-1]) uvwspacing.value true 0 true true -- interface value. uvwspacing.
 
 bakeRender i Mapsize:512
 i.iNodeBakeProperties.removeAllBakeElements()
 )
) -- end normal bake . 
------------------------------
) createdialog bakevray

is here anybody help me to register on this website ? this is the home page of vray . but i cant register ,got error message : “invalid access …” i dont know why . maybe the version of the website server is old . and has some bugs .

http://www.chaosgroup.com/forum/phpBB2/profile.php?sid=08b523b65452e844663e8a279981d4b6

i show my info here . maybe someone can help me register it :

name : hblan
key: … –u set one for me .
email: http://forums.cgsociety.org/haibo.lan@gmail.co m” data-bbcode=”true”>haibo.lan@gmail.com

thanks very much .