Announcement

Collapse
No announcement yet.

matte material/ shadow catcher for Blender

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

  • matte material/ shadow catcher for Blender

    Hey everyone! I've made some efforts to get the shadow catcher matte material working in Vray for Blender. Here's what I've been able to put together. Some notes:

    1. The matte material seems to have several inputs duplicated, I think they should be combined in the node. (For example, there are 3 places to put the alpha contribution! And they're not all connected)

    2. With the background image, I can't find a way for the shadow not to pick up the image in the background. I have to disconnect the background image (in the "world" node) for the shadow to be clean and not show the grass through.

    blend file attached.

    Andy
    Attached Files

  • #2
    Andy, that's awesome.

    Comment


    • #3
      This is using object Wrapper, no material nodes needed to create shadow catcher.
      Select your shadow catcher objects and run this script, it will change those 5 green values and set "Matte "-text beginning of your object names. Run script again and it toggles selected objects Wrapper off/on and changes object names back.



      Code:
      import bpy
      
      matte = 'Matte '
      objs =[o for o in bpy.context.selected_objects if o.type in ('MESH', 'CURVE','SURFACE','META','FONT')]
      for o in objs:
          if o.vray.MtlWrapper.use:
              o.vray.MtlWrapper.use = False
              o.name = o.name[6:] if o.name[:6] == matte else o.name
      
          else:    
              o.vray.MtlWrapper.use = True
              o.vray.MtlWrapper.matte_surface = True
              o.vray.MtlWrapper.affect_alpha = True
              o.vray.MtlWrapper.shadows = True
              o.vray.MtlWrapper.alpha_contribution = -1
              o.name = matte + o.name if o.name[:6] != matte else o.name
      Attached Files
      Win7 Ultimate 64bit, GTX 970, Standalone version: V-Ray Next 4.30.03,

      Comment

      Working...
      X