Remove Blender Internal and legacy viewport from Blender 2.8.

Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!

* Point density, voxel data, ocean, environment map textures were removed,
  as these only worked within BI rendering. Note that the ocean modifier
  and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
  with BI. If we ever wanted to support this again probably it should go
  through the baking API.
* GPU shader export through the Python API was removed. This only worked
  for the old BI GLSL shaders, which no longer exists. Doing something
  similar for Eevee would be significantly more complicated because it
  uses a lot of multiplass rendering and logic outside the shader, it's
  probably impractical.
* Collada material import / export code is mostly gone, as it only worked
  for BI materials. We need to add Cycles / Eevee material support at some
  point.
* The mesh noise operator was removed since it only worked with BI
  material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
  for BI material texture slots. Could be added back with node support.

* Not all legacy viewport features are supported in the new viewport, but
  their code was removed. If we need to bring anything back we can look at
  older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
  that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
  used anywhere now. We may eventually use this to replace the texture
  nodes with Cycles / Eevee shader nodes.

* The Cycles Bake panel now includes settings for baking multires normal
  and displacement maps. The underlying code needs to be merged properly,
  and we plan to add back support for multires AO baking and add support
  to Cycles baking for features like vertex color, displacement, and other
  missing baking features.

* This commit removes DNA and the Python API for BI material, lamp, world
  and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
  are reusing some old BI properties but the names are not really correct
  anymore.
* Texture slots for materials, lamps and world were removed. They remain
  for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
  other renderers use this to find all panels to show, minus a few panels
  that they have their own replacement for.
This commit is contained in:
2018-04-19 17:34:44 +02:00
committed by Brecht Van Lommel
parent 785e8a636a
commit 51b796ff15
309 changed files with 1326 additions and 83714 deletions

View File

@@ -364,88 +364,38 @@ class QuickSmoke(Operator):
# Setup material
# Cycles
if context.scene.render.use_shading_nodes or context.render.use_shading_nodes:
bpy.ops.object.material_slot_add()
# Cycles and Eevee
bpy.ops.object.material_slot_add()
mat = bpy.data.materials.new("Smoke Domain Material")
obj.material_slots[0].material = mat
mat = bpy.data.materials.new("Smoke Domain Material")
obj.material_slots[0].material = mat
# Make sure we use nodes
mat.use_nodes = True
# Make sure we use nodes
mat.use_nodes = True
# Set node variables and clear the default nodes
tree = mat.node_tree
nodes = tree.nodes
links = tree.links
# Set node variables and clear the default nodes
tree = mat.node_tree
nodes = tree.nodes
links = tree.links
nodes.clear()
nodes.clear()
# Create shader nodes
# Create shader nodes
# Material output
node_out = nodes.new(type='ShaderNodeOutputMaterial')
node_out.location = grid_location(6, 1)
# Material output
node_out = nodes.new(type='ShaderNodeOutputMaterial')
node_out.location = grid_location(6, 1)
# Add Principled Volume
node_principled = nodes.new(type='ShaderNodeVolumePrincipled')
node_principled.location = grid_location(4, 1)
links.new(node_principled.outputs["Volume"],
node_out.inputs["Volume"])
# Add Principled Volume
node_principled = nodes.new(type='ShaderNodeVolumePrincipled')
node_principled.location = grid_location(4, 1)
links.new(node_principled.outputs["Volume"],
node_out.inputs["Volume"])
node_principled.inputs["Density"].default_value = 5.0
node_principled.inputs["Density"].default_value = 5.0
if self.style in {'FIRE', 'BOTH'}:
node_principled.inputs["Blackbody Intensity"].default_value = 1.0
# Blender Internal
else:
# create a volume material with a voxel data texture for the domain
bpy.ops.object.material_slot_add()
mat = bpy.data.materials.new("Smoke Domain Material")
obj.material_slots[0].material = mat
mat.type = 'VOLUME'
mat.volume.density = 0
mat.volume.density_scale = 5
mat.volume.step_size = 0.1
tex = bpy.data.textures.new("Smoke Density", 'VOXEL_DATA')
tex.voxel_data.domain_object = obj
tex.voxel_data.interpolation = 'TRICUBIC_BSPLINE'
tex_slot = mat.texture_slots.add()
tex_slot.texture = tex
tex_slot.texture_coords = 'ORCO'
tex_slot.use_map_color_emission = False
tex_slot.use_map_density = True
tex_slot.use_map_color_reflection = True
# for fire add a second texture for flame emission
mat.volume.emission_color = Vector((0.0, 0.0, 0.0))
tex = bpy.data.textures.new("Flame", 'VOXEL_DATA')
tex.voxel_data.domain_object = obj
tex.voxel_data.smoke_data_type = 'SMOKEFLAME'
tex.voxel_data.interpolation = 'TRICUBIC_BSPLINE'
tex.use_color_ramp = True
tex_slot = mat.texture_slots.add()
tex_slot.texture = tex
tex_slot.texture_coords = 'ORCO'
# add color ramp for flame color
ramp = tex.color_ramp
# dark orange
elem = ramp.elements.new(0.333)
elem.color = (0.2, 0.03, 0.0, 1.0)
# yellow glow
elem = ramp.elements.new(0.666)
elem.color = (1, 0.65, 0.25, 1.0)
mat.texture_slots[1].use_map_density = True
mat.texture_slots[1].use_map_emission = True
mat.texture_slots[1].emission_factor = 5
if self.style in {'FIRE', 'BOTH'}:
node_principled.inputs["Blackbody Intensity"].default_value = 1.0
return {'FINISHED'}
@@ -547,13 +497,33 @@ class QuickFluid(Operator):
mat = bpy.data.materials.new("Fluid Domain Material")
obj.material_slots[0].material = mat
mat.specular_intensity = 1
mat.specular_hardness = 100
mat.use_transparency = True
mat.alpha = 0.0
mat.transparency_method = 'RAYTRACE'
mat.raytrace_transparency.ior = 1.33
mat.raytrace_transparency.depth = 4
# Make sure we use nodes
mat.use_nodes = True
# Set node variables and clear the default nodes
tree = mat.node_tree
nodes = tree.nodes
links = tree.links
nodes.clear()
# Create shader nodes
# Material output
node_out = nodes.new(type='ShaderNodeOutputMaterial')
node_out.location = grid_location(6, 1)
# Add Glass
node_glass = nodes.new(type='ShaderNodeBsdfGlass')
node_glass.location = grid_location(4, 1)
links.new(node_glass.outputs["BSDF"], node_out.inputs["Surface"])
node_glass.inputs["IOR"].default_value = 1.33
# Add Absorption
node_absorption = nodes.new(type='ShaderNodeVolumeAbsorption')
node_absorption.location = grid_location(4, 2)
links.new(node_absorption.outputs["Volume"], node_out.inputs["Volume"])
node_absorption.inputs["Color"].default_value = (0.8, 0.9, 1.0, 1.0)
if self.start_baking:
bpy.ops.fluid.bake('INVOKE_DEFAULT')