Announcement

Collapse
No announcement yet.

Can't texture bake through maxscript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't texture bake through maxscript

    So I'm having trouble texturebaking through maxscript (Vray 2.4, max 2014). Here's a sample script:

    theObject1 = Sphere segs:32 mapcoords:true pos:[0,0,25]
    theObject2 = Sphere segs:32 mapcoords:true pos:[0,0,100]
    theMap = cellular cellColor:blue divColor1:red divColor2:yellow size:15
    themat = standard diffusemap:theMap
    theObject1.material = themat
    theObject2.material = themat

    objs = #(theObject1,theObject2)
    for o in objs do
    (
    o.iNodeBakeProperties.removeAllBakeElements()
    be1 = diffusemap()
    be1.outputSzX = be1.outputSzY = 1024
    be1.fileType = ("D:\\" + o.name + ".png")
    be1.fileName = filenameFromPath be1.fileType
    be1.filterOn = true
    be1.shadowsOn = false
    be1.lightingOn = false
    be1.enabled = true
    o.INodeBakeProperties.addBakeElement be1
    o.INodeBakeProperties.bakeEnabled = true
    o.INodeBakeProperties.bakeChannel = 1
    o.INodeBakeProperties.nDilations = 1
    )
    select objs
    render rendertype:#bakeSelected vfbff progressBar:true outputSize:[1024,1024]

    If I render with scanline, it's fine. But if I set vray as my renderer, I get

    Click image for larger version

Name:	bakingCrash.jpg
Views:	1
Size:	45.0 KB
ID:	878635

    Any idea what's going on? Thanks.

    - Neil
    Last edited by soulburn3d; 28-09-2013, 08:36 PM.

  • #2
    Hi,

    Im able to reproduce the crash here and will discuss it with our developers.

    As a workaround you can use Vraydiffusefiltermap instead of the 3DS max native Diffuse one.
    Here is the code:

    theObject1 = Sphere segs:32 mapcoords:true pos:[0,0,25]
    theObject2 = Sphere segs:32 mapcoords:true pos:[0,0,100]
    theMap = cellular cellColor:blue divColor1:red divColor2:yellow size:15
    themat = standard diffusemap:theMap
    theObject1.material = themat
    theObject2.material = themat

    objs = #(theObject1)
    for o in objs do
    (

    o.iNodeBakeProperties.removeAllBakeElements()
    be1 = vraydiffusefiltermap()
    be1.fileType = ("c:\\" + o.name + ".jpg")
    be1.fileName = filenameFromPath be1.fileType
    be1.enabled = true
    o.INodeBakeProperties.addBakeElement be1
    o.INodeBakeProperties.bakeEnabled = false
    o.INodeBakeProperties.bakeChannel = 1
    o.INodeBakeProperties.nDilations = 1
    )
    select objs
    render rendertype:#bakeSelected vfbff progressBar:true outputSize:[1024,1024]
    Tashko Zashev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      Thanks for the info. Looks like vraydiffusefiltermap() is missing some stuff though.

      First, the property "shadowsOn" is called "shadowOn" in vray, the s was omitted.

      Second, "lightingOn" doesn't seem to exist at all.

      Can we have the first one fixed, and is the second property necessary?

      - Neil

      Comment


      • #4
        Originally posted by soulburn3d View Post
        Thanks for the info. Looks like vraydiffusefiltermap() is missing some stuff though.

        First, the property "shadowsOn" is called "shadowOn" in vray, the s was omitted.
        Please note that only the available properties in the render to texture (Vraydiffusefilter map) interface can be adjusted at the moment.
        The "ShadowON" parameter will not have any affect of the baking process at all.

        Second, "lightingOn" doesn't seem to exist at all.
        Actually I'm not sure how this option works for the native 3DS max Diffuse baking map.
        Is it important for your workflow?
        I made few tests and didn't see any difference in the render result between the Diffuse and VRayDiffuseFilter maps.

        Can we have the first one fixed, and is the second property necessary?
        Unfortunately we are not able to fix this, our recommendations is to use the available V-ray maps instead.
        Tashko Zashev | chaos.com
        Chaos Support Representative | contact us

        Comment


        • #5
          So setting both ShadowOn and LightingOn to false means I'm trying to bake just the regular diffuse color with no shadow or lighting information. If I wanted to see lights or shadows on my baked map, I'd turn these to true. So are you saying that you currently can't bake shadows or light using the vraydiffusefiltermap baking map?

          - Neil

          Comment


          • #6
            Originally posted by soulburn3d View Post
            So are you saying that you currently can't bake shadows or light using the vraydiffusefiltermap baking map?
            Nope, you can't. You'll have to use it in conjunction with some of the other bake elements (f.e. the VRayLightingMap, VRayRawLightingMap, VRayShadowMap, VRayRawShadowMap etc).

            Best regards,
            Vlado
            I only act like I know everything, Rogers.

            Comment


            • #7
              Ah, so I misunderstood. I was under the impression that vraydiffusefiltermap was pretty much the vray version of diffusemap. But in fact, diffusemap does either purely diffuse color or diffuse with lighting, and vraydiffusefiltermap does only purely diffuse color. Thanks for the clarification.

              - Neil

              Comment

              Working...
              X