Support for Out of touch hair shaders

Issue #1495 invalid
Rakete created an issue

I noticed I am getting an error popup when importing hair from the PA Out of Touch, complaining that shaders “OOT Hairblending Hair” and “Cap” are unsupported. The hair also imports looking wrong, the transparency is missing making it look blocky.

The problem can be fixed by changing setExtra in material.py:

def setExtra(self, struct):
        if struct["type"] == "studio/material/uber_iray":
            self.shader = 'UBER_IRAY'
        elif struct["type"] == "studio/material/daz_brick":
            shadername = unquote(self.url.rsplit("#",1)[-1])
            if shadername == "PBRSkin":
                self.shader = 'PBRSKIN'
            elif shadername == "OOT Hairblending Hair" or shadername == "Cap":
                # "OOT Hairblending Hair", "Cap" are shaders that the Out of Touch PA uses
                # for hair
                self.shader = 'UBER_IRAY'
            else:
                self.shader = 'BRICK'
                print("Unknown brick shader", shadername)
                LS.shaders[shadername] = True
        elif struct["type"] == "studio/material/daz_shader":
            self.shader = 'DAZ_SHADER'
            if "definition" in struct.keys():
                print("Unknown shader definition", struct["definition"])
                LS.shaders[struct["definition"]] = True
        elif struct["type"].startswith("studio/material/"):
            print("Unknown shader type", struct["type"])
            LS.shaders[struct["type"]] = True

I just guessed that UBER_IRAY would work for them, it seems that it mostly does since the hair looks alright after the change. I don’t really render that much using blender though so I can’t tell, I mostly use eevee too.

Comments (4)

  1. Alessandro Padovani

    Custom shaders and some 3delight shaders are not supported thus the message is warning you. You may try to convert to uber before exporting, for most shaders the conversion works fine enough, otherwise you have to fix it in blender.

    To convert to uber in daz studio select the materials and apply the iray uber shader.

    If there’s nothing to add I’ll close as invalid.

  2. Rakete reporter

    Is converting to Uber in Daz the same as importing them as UBER_IRAY like my change does? Then maybe it makes sense to have a list of these shaders that are converted to Uber by default so it happens automatically?

  3. Alessandro Padovani

    No it is not the same. Converting to uber in daz does convert the materials, while importing a custom shader as uber in blender simply handles it differently when loading the materials attributes, that may be a better handling in this case but it’s by coincidence and it’s not a conversion to uber in any way.

    p.s. It may be a note for Thomas to distinguish among 3delight and bricks then look at uber attributes first if it is a brick, but this is a minor optimization and not too useful in the general case. The correct way is to convert to uber in daz studio before exporting, then fix it in blender if it doesn’t work fine.

  4. Log in to comment