Announcement

Collapse
No announcement yet.

Displacement converter

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

  • Displacement converter

    Would be nice to have a script that could convert displacement in a scene's materials to VrayDisplacement - mainly to cut down on render times. I have a scene with a lot of built in displacement in the mats and I'm kinda bugged.
    LunarStudio Architectural Renderings
    HDRSource HDR & sIBL Libraries
    Lunarlog - LunarStudio and HDRSource Blog

  • #2
    Hi jujubee,
    you mean : convert mterial to vraymat and crate vraydisplacemod for the concerned object ?
    or just use the global Vray displacement ?
    Jérôme Prévost.
    SolidRocks, the V-Ray Wizard.
    http://solidrocks.subburb.com

    Comment


    • #3
      Well, Vraydisplacement happens on a per object basis in an object's stack.

      For example, I've downloaded some mats off of the Vray Materials website. Many of the "better" materials actually have a map in the displacement slot with it checked on. The problem with this is that it can add minutes or even longer to a rendering. I just had a rendering where it was being used in 4 different locations and I had to locate all of them. They literally added about 20 mins to my rendering.

      While it's not a perfect solution, it would be better if there was some way to run a script that would:

      1) look at all of your Vray materials being used and check to see if local displacement has a used map in it.
      2) Find the object(s) that it is being used on (I found that some people who create materials have it in the slot, but sometimes leave it unchecked so it has to take that checkbox into factor.)
      3) Apply a VrayDisplacement modifier to that object(s). Perhaps that's set to 2D by default? I haven't figured that part of the settings out, but it should somewhat approximate what it would do if the map was used in the actual material displacement.
      4) Cut the map out of the Vray Material's displacement.
      5) Place copies of the displacement map in the objects modifier stack using VrayDisplacement. Perhaps if there's a UVW map already applied, it will automatically insert it under that (good idea or bad?)

      If I could code it myself, I would. But I can't code. And I also suck at it.

      As for standard Max mats - I wasn't even thinking about them. People should avoid them at all costs unless absolutely necessary. I think if you're writing something for Solidrocks, that's another idea. Perhaps adding a separate section in your plugin which lists standard mats being used could be displayed.
      Last edited by jujubee; 12-03-2010, 03:34 AM.
      LunarStudio Architectural Renderings
      HDRSource HDR & sIBL Libraries
      Lunarlog - LunarStudio and HDRSource Blog

      Comment


      • #4
        I'm also beginning to think that if possible for Chaosgroup to do, the displacement map button in the Vraymats should be completely replaced with a section similar to the VrayDisplacment Modifier. It could have its own parameters.

        I think it would be more convenient than having it listed in two separate places. Plus, it makes organizing your material libraries much easier.
        LunarStudio Architectural Renderings
        HDRSource HDR & sIBL Libraries
        Lunarlog - LunarStudio and HDRSource Blog

        Comment


        • #5
          +1 of the last, Jujubee have a very nice and useful idea .
          Best regards,
          Andrian
          _____________________________________
          www.fekta.eu
          Portfolio
          CG Talk

          Comment


          • #6
            +1 I am not really sure what the upside is for having a modifier for this. I'm sure there were/are good reasons, but it would certainly be much simpler if it was all in the mat.

            b
            Brett Simms

            www.heavyartillery.com
            e: brett@heavyartillery.com

            Comment


            • #7
              This will do the basics for you, hopefully you can work on it from here.

              Rgds

              Dave

              Code:
              -- This script will go through the selected object and check to see if their Vraymtl 
              -- has a displacement map and if so it will add a VrayDisplacementMod and copy the 
              -- materials map to the modifier.
              
              
              for o in selection do
              (
              
              --get objs material
              themap = o.material
              
              	--check for vraymtl
              	if (classof themap)==VRayMtl then 
              	(
              	--apply disp mod
              	--check for displacement
              	if themap.texmap_displacement != undefined then 
              		(
              		--if it's a vray mtl with displacement then we can add the displace modifier and grab the mtl
              		addModifier o (VrayDisplacementMod())
              		
              		--assign mat from material
              		o.modifiers[#VRayDisplacementMod].type = 1
              		o.modifiers[#VRayDisplacementMod].texmap = themap.texmap_displacement
              		--disable displacement channel in the material
              		themap.texmap_displacement_on = off
              		)
              	)
              )
              Maxscript made easy....
              davewortley.wordpress.com
              Follow me here:
              facebook.com/MaxMadeEasy

              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

              Comment


              • #8
                Awesome. Thanks Dave. I'll have to give it a test next time I encounter this.
                LunarStudio Architectural Renderings
                HDRSource HDR & sIBL Libraries
                Lunarlog - LunarStudio and HDRSource Blog

                Comment

                Working...
                X