Cycles microdisplacement: change use subdivision bool to subdivision type enum
This is only the UI change, there is no underlying code change in this commit. Reviewed By: brecht Differential Revision: https://developer.blender.org/D1910
This commit is contained in:

committed by
Brecht Van Lommel

parent
ebfdd7da83
commit
d456458e06
@@ -46,6 +46,12 @@ enum_displacement_methods = (
|
|||||||
('BOTH', "Both", "Combination of displacement and bump mapping"),
|
('BOTH', "Both", "Combination of displacement and bump mapping"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
enum_subdivision_types = (
|
||||||
|
('NONE', "None", "No subdivision"),
|
||||||
|
('LINEAR', "Linear", "Use linear subdivision"),
|
||||||
|
('CATMULL_CLARK', "Catmull–Clark", "Use Catmull-Clark subdivision"),
|
||||||
|
)
|
||||||
|
|
||||||
enum_bvh_types = (
|
enum_bvh_types = (
|
||||||
('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
|
('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
|
||||||
('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
|
('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
|
||||||
@@ -931,10 +937,11 @@ class CyclesMeshSettings(bpy.types.PropertyGroup):
|
|||||||
items=enum_displacement_methods,
|
items=enum_displacement_methods,
|
||||||
default='BUMP',
|
default='BUMP',
|
||||||
)
|
)
|
||||||
cls.use_subdivision = BoolProperty(
|
cls.subdivision_type = EnumProperty(
|
||||||
name="Use Subdivision",
|
name="Subdivision Type",
|
||||||
description="Subdivide mesh for rendering",
|
description="Type of subdivision to use",
|
||||||
default=False,
|
items=enum_subdivision_types,
|
||||||
|
default='NONE',
|
||||||
)
|
)
|
||||||
cls.dicing_rate = FloatProperty(
|
cls.dicing_rate = FloatProperty(
|
||||||
name="Dicing Rate",
|
name="Dicing Rate",
|
||||||
|
@@ -682,7 +682,7 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel):
|
|||||||
cdata = mball.cycles
|
cdata = mball.cycles
|
||||||
|
|
||||||
layout.prop(cdata, "displacement_method", text="Method")
|
layout.prop(cdata, "displacement_method", text="Method")
|
||||||
layout.prop(cdata, "use_subdivision")
|
layout.prop(cdata, "subdivision_type", text="Subdivision")
|
||||||
layout.prop(cdata, "dicing_rate")
|
layout.prop(cdata, "dicing_rate")
|
||||||
|
|
||||||
|
|
||||||
|
@@ -808,7 +808,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
|
|||||||
|
|
||||||
if(b_mesh) {
|
if(b_mesh) {
|
||||||
if(render_layer.use_surfaces && !hide_tris) {
|
if(render_layer.use_surfaces && !hide_tris) {
|
||||||
if(cmesh.data && experimental && RNA_boolean_get(&cmesh, "use_subdivision"))
|
if(cmesh.data && experimental && RNA_enum_get(&cmesh, "use_subdivision"))
|
||||||
create_subd_mesh(scene, mesh, b_ob, b_mesh, &cmesh, used_shaders);
|
create_subd_mesh(scene, mesh, b_ob, b_mesh, &cmesh, used_shaders);
|
||||||
else
|
else
|
||||||
create_mesh(scene, mesh, b_mesh, used_shaders);
|
create_mesh(scene, mesh, b_mesh, used_shaders);
|
||||||
|
Reference in New Issue
Block a user