# Can I use Cycles materials with Blender Internal?

Is it possible to have a mesh coloured and textured in cycles and then have it displayed in internal?

The only reason I ask is because I am building a log cabin and want to put some windows in. When I have done glass in cycles (Nodes) it looks much better (realistic) but when I try to do this and go back into blender internal to finish the rest of the log cabin off the window and the mesh surrounding the window becomes undefined and discoloured.

Is this because I am trying to put cycles into internal or because I am doing something wrong?

You can do something like what your asking with multiple scenes. Bear in mind, you will have a lot of extra work/tweaking/headaches when you have to adjust two scenes, but if it's necessary it's worth the trouble. Just link objects that shouldn't change between scenes (i.e. camera/lights)

## Scene Setup

1. Create a new scene
2. Move your cycles object (the windows) to "Scene.001" (CtrlL > Objects to Scene > Scene.001 and and delete the object from "Scene")
3. Select "Scene.001" and go to the world settings:
5. Set your render engine to Cycles
6. Switch back to "scene". You should notice that the render engine will change between the two scenes.
7. Link your camera and lights to "Scene.001" (but don't delete them from "scene"). You can now move your camera and lights around and they will have the same location/rotation/scale in both of the scenes.

Render both scenes with transparent skies.

## Compositing

1. Go to the compositor.
2. Enable Compositing Nodes
3. Add a new Render Layers node and select "Scene.001" from the drop down.
4. Add an alpha over node and plug them in so that one scene is on top of the other.

You will now have a Cycles object rendered in a Blender Internal scene.

• you say render both scenes with a transparent skies, this is easy in cycles as the option appears but in internal how is this done? Thank you for the step through guide most helpful. – Lindsey Jul 10 '13 at 13:17
• You can set it by changing the output RGBA, but it doesn't really matter because you'll be mixing the cycles scene on top of the BI scene. – CharlesL Jul 10 '13 at 13:33
• @Lindsey, I added a relevant link as to how to do this. – iKlsR Jul 10 '13 at 14:37

You can't use cycles and blender internal materials in the same scene.

You can make a copy or link from the current scene, change render engine and materials in it and use the compositor to combine the two scenes. Adjusting renderlayers in the cycles one so that only the glass is visible, and hiding it in internal should be possible. You can have nodes of both render engines in the same material setup, but you need a scene for both engines to render both.

• Actually you can assign materials for both engines in the same scene, using nodes. See this post by the Urchn studio for details. – Aldrik Jul 10 '13 at 14:27
• @Aldrik, I know, you can't use them both at the same time though, which was the point here. Rewording a bit to make that clearer. – hjaarnio Jul 10 '13 at 14:47

I had a similar problem, so I cobbled together a quick script.

I like my final renders to be in cycles, but I like to work in Blender Internal. The script swaps materials on selected objects. All materials named Cycles.whatever or GLSL.whatever will be replaced with the one appropriate for the current rendering engine. Note, this doesn't make the materials for you, just swaps from one to the other.

Takes more time up front, because I have to make two sets of materials, but it saves me a lot of time in the project because Blender Internal is so much faster than cycles and looks better during modeling.

# This script should go through all the materials in the SELECTED objects and replace them with another material (that you made) who's name is prefixed with Cycles or GLSL accordingly

# Switch the renderer, select some objects, then run this script.
# You'll need two copies of every material, one for cycles and one for GLSL.
# Just name the materials CYCLES.whatever and GLSL.whatever

# eg: Cycles.black.glossy <-> GLSL.black.glossy

import bpy
context = bpy.context # only selected items

print(bpy.data.scenes["Scene"].render.engine)

RenderEngine = bpy.data.scenes["Scene"].render.engine

if RenderEngine == "BLENDER_GAME" or RenderEngine == "BLENDER_RENDER":
DesiredMaterialNamePrefix = "GLSL"
UndesiredMaterialNamePrefix = "Cycles"
elif RenderEngine == "CYCLES":
DesiredMaterialNamePrefix = "Cycles"
UndesiredMaterialNamePrefix = "GLSL"

print("---------------------------------------")

mesh_objs = [ob for ob in context.selected_objects if ob.type == 'MESH']

print("Materials in scene")
print(dir(bpy.data.materials))

for mesh in mesh_objs:

print(repr(mesh))

print("active_slot:", mesh.active_material_index)
if mesh.active_material is not None:
#print("active_material:", repr(mesh.active_material) )
print("active_material:", mesh.active_material.name)

for materialSlot, mat in enumerate(mesh.material_slots):
if not materialSlot:
print("material_slots")
if mat is not None:
print("\t[%d] = %s" % (materialSlot, mat.name))

# figure out if the undesired renderer is in the material name
# if so, change the material to match the desired renderer
# (but verify that the material actually exists before you try to make the swap)

if (mat.name.find(UndesiredMaterialNamePrefix) != -1):
print("Found material: ", mat.name)
desiredMaterialName = mat.name.replace(UndesiredMaterialNamePrefix, DesiredMaterialNamePrefix)
print("Change to: ", desiredMaterialName)
print("finding material")
newMaterial = bpy.data.materials.get(desiredMaterialName)
if newMaterial is not None:
print(repr(newMaterial))
mesh.material_slots[materialSlot].material = newMaterial
#print(newMaterial.name)
else:
print("No equivalent Material found for ", desiredMaterialName)

elif (mat.name.find(DesiredMaterialNamePrefix) != -1):
print("Found Desired Renderer: ", DesiredMaterialNamePrefix)
print(repr(mat))
print("No change necessary")

else:
print("\t[%d] is None" % materialSlot)

print()