Fix T38192: OSL got incorrectly enabled in preview render when GPU was selected

for rendering of the main scene.
This commit is contained in:
Brecht Van Lommel 2014-01-13 23:29:35 +01:00
parent 6eedf08cca
commit a02a97753b
Notes: blender-bot 2023-02-14 11:21:34 +01:00
Referenced by issue #38192, turning on osl will crash gpu rendering
Referenced by issue #38192, turning on osl will crash gpu rendering
1 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,8 @@ class CyclesRender(bpy.types.RenderEngine):
def update(self, data, scene):
if self.is_preview:
if not self.session:
use_osl = bpy.context.scene.cycles.shading_system
cscene = bpy.context.scene.cycles
use_osl = cscene.shading_system and cscene.device == 'CPU'
engine.create(self, data, scene,
None, None, None, use_osl)