diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-10 22:25:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-10 22:30:45 +0300 |
commit | fbc03fdd10836f79c509e5d8c19514bc5f983253 (patch) | |
tree | 98400266dd9245625b4a148fa1a82f1ba174b2c1 /materials_utils/material_converter.py | |
parent | 45f47e15d4d9c0629a9a277f8d665f806f7834a7 (diff) |
Cycles: update addons for squared roughness convention.
Diffstat (limited to 'materials_utils/material_converter.py')
-rw-r--r-- | materials_utils/material_converter.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/materials_utils/material_converter.py b/materials_utils/material_converter.py index c682e612..bf52bec1 100644 --- a/materials_utils/material_converter.py +++ b/materials_utils/material_converter.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import bpy +import math from mathutils import Vector from bpy.types import Operator from .warning_messages_utils import ( @@ -665,7 +666,7 @@ def makeCyclesFromBI(cmat): # Make Diffuse and Output nodes mainShader = makeMainShader(TreeNodes) - mainShader.inputs['Roughness'].default_value = cmat.specular_intensity + mainShader.inputs['Roughness'].default_value = math.sqrt(max(cmat.specular_intensity, 0.0)) mainDiffuse = mainShader materialOutput = makeMaterialOutput(TreeNodes) links.new(mainShader.outputs['BSDF'], materialOutput.inputs['Surface']) |