def _parse_material(effect, resolver):
    '\n    Turn a COLLADA effect into a trimesh material.\n    '
    baseColorFactor = np.ones(4)
    baseColorTexture = None
    if isinstance(effect.diffuse, collada.material.Map):
        try:
            baseColorTexture = _load_texture(effect.diffuse.sampler.surface.image.path, resolver)
        except BaseException:
            log.warning('unable to load base texture', exc_info=True)
    elif (effect.diffuse is not None):
        baseColorFactor = effect.diffuse
    emissiveFactor = np.zeros(3)
    emissiveTexture = None
    if isinstance(effect.emission, collada.material.Map):
        try:
            emissiveTexture = _load_texture(effect.diffuse.sampler.surface.image.path, resolver)
        except BaseException:
            log.warning('unable to load emissive texture', exc_info=True)
    elif (effect.emission is not None):
        emissiveFactor = effect.emission[:3]
    roughnessFactor = 1.0
    if ((not isinstance(effect.shininess, collada.material.Map)) and (effect.shininess is not None)):
        roughnessFactor = np.sqrt((2.0 / (2.0 + effect.shininess)))
    metallicFactor = 0.0
    normalTexture = None
    if (effect.bumpmap is not None):
        try:
            normalTexture = _load_texture(effect.bumpmap.sampler.surface.image.path, resolver)
        except BaseException:
            log.warning('unable to load bumpmap', exc_info=True)
    if ((effect.transparent is not None) and (not isinstance(effect.transparent, collada.material.Map))):
        baseColorFactor = tuple(np.append(baseColorFactor[:3], effect.transparent[3]))
    return visual.material.PBRMaterial(emissiveFactor=emissiveFactor, emissiveTexture=emissiveTexture, normalTexture=normalTexture, baseColorTexture=baseColorTexture, baseColorFactor=baseColorFactor, metallicFactor=metallicFactor, roughnessFactor=roughnessFactor)
Turn a COLLADA effect into a trimesh material.
def _parse_material(effect, resolver):
    '\n    \n    '
    baseColorFactor = np.ones(4)
    baseColorTexture = None
    if isinstance(effect.diffuse, collada.material.Map):
        try:
            baseColorTexture = _load_texture(effect.diffuse.sampler.surface.image.path, resolver)
        except BaseException:
            log.warning('unable to load base texture', exc_info=True)
    elif (effect.diffuse is not None):
        baseColorFactor = effect.diffuse
    emissiveFactor = np.zeros(3)
    emissiveTexture = None
    if isinstance(effect.emission, collada.material.Map):
        try:
            emissiveTexture = _load_texture(effect.diffuse.sampler.surface.image.path, resolver)
        except BaseException:
            log.warning('unable to load emissive texture', exc_info=True)
    elif (effect.emission is not None):
        emissiveFactor = effect.emission[:3]
    roughnessFactor = 1.0
    if ((not isinstance(effect.shininess, collada.material.Map)) and (effect.shininess is not None)):
        roughnessFactor = np.sqrt((2.0 / (2.0 + effect.shininess)))
    metallicFactor = 0.0
    normalTexture = None
    if (effect.bumpmap is not None):
        try:
            normalTexture = _load_texture(effect.bumpmap.sampler.surface.image.path, resolver)
        except BaseException:
            log.warning('unable to load bumpmap', exc_info=True)
    if ((effect.transparent is not None) and (not isinstance(effect.transparent, collada.material.Map))):
        baseColorFactor = tuple(np.append(baseColorFactor[:3], effect.transparent[3]))
    return visual.material.PBRMaterial(emissiveFactor=emissiveFactor, emissiveTexture=emissiveTexture, normalTexture=normalTexture, baseColorTexture=baseColorTexture, baseColorFactor=baseColorFactor, metallicFactor=metallicFactor, roughnessFactor=roughnessFactor)