Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-10 22:25:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-10 22:30:45 +0300
commitfbc03fdd10836f79c509e5d8c19514bc5f983253 (patch)
tree98400266dd9245625b4a148fa1a82f1ba174b2c1 /materials_utils/material_converter.py
parent45f47e15d4d9c0629a9a277f8d665f806f7834a7 (diff)
Cycles: update addons for squared roughness convention.
Diffstat (limited to 'materials_utils/material_converter.py')
-rw-r--r--materials_utils/material_converter.py3
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'])