diff options
author | Thomas Dinges <blender@dingto.org> | 2015-02-19 14:36:13 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-02-19 14:37:56 +0300 |
commit | 27d1446d24cc9d4146a94c2ece8146838af5cdca (patch) | |
tree | b5d634e2af9d3afd7a2c5b6fa821d4330e844dbd /intern/cycles | |
parent | ebdc1cde3feea7969448cf1817a1e01d0f4709a2 (diff) |
Cleanup: Restructure curve settings code a bit.
This is a bit more logical, as it better represents the 3 primitive types we have.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 67358ec0417..72023d7e69b 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -801,30 +801,38 @@ void BlenderSync::sync_curve_settings() curve_system_manager->subdivisions = get_int(csscene, "subdivisions"); curve_system_manager->use_backfacing = !get_boolean(csscene, "cull_backfacing"); - if(curve_system_manager->primitive == CURVE_TRIANGLES && curve_system_manager->curve_shape == CURVE_RIBBON) { + /* Triangles */ + if(curve_system_manager->primitive == CURVE_TRIANGLES) { /* camera facing planes */ - curve_system_manager->triangle_method = CURVE_CAMERA_TRIANGLES; - curve_system_manager->resolution = 1; - } - else if(curve_system_manager->primitive == CURVE_TRIANGLES && curve_system_manager->curve_shape == CURVE_THICK) { - /* camera facing planes */ - curve_system_manager->triangle_method = CURVE_TESSELATED_TRIANGLES; - } - else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) { - /* tangent shading */ - curve_system_manager->line_method = CURVE_UNCORRECTED; - curve_system_manager->use_encasing = true; - curve_system_manager->use_backfacing = false; - curve_system_manager->use_tangent_normal_geometry = true; + if(curve_system_manager->curve_shape == CURVE_RIBBON) { + curve_system_manager->triangle_method = CURVE_CAMERA_TRIANGLES; + curve_system_manager->resolution = 1; + } + else if(curve_system_manager->curve_shape == CURVE_THICK) { + curve_system_manager->triangle_method = CURVE_TESSELATED_TRIANGLES; + } } - else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_THICK) { - curve_system_manager->line_method = CURVE_ACCURATE; - curve_system_manager->use_encasing = false; - curve_system_manager->use_tangent_normal_geometry = false; + /* Line Segments */ + else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS) { + if(curve_system_manager->curve_shape == CURVE_RIBBON) { + /* tangent shading */ + curve_system_manager->line_method = CURVE_UNCORRECTED; + curve_system_manager->use_encasing = true; + curve_system_manager->use_backfacing = false; + curve_system_manager->use_tangent_normal_geometry = true; + } + else if(curve_system_manager->curve_shape == CURVE_THICK) { + curve_system_manager->line_method = CURVE_ACCURATE; + curve_system_manager->use_encasing = false; + curve_system_manager->use_tangent_normal_geometry = false; + } } - else if(curve_system_manager->primitive == CURVE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) { - curve_system_manager->primitive = CURVE_RIBBONS; - curve_system_manager->use_backfacing = false; + /* Curve Segments */ + else if(curve_system_manager->primitive == CURVE_SEGMENTS) { + if(curve_system_manager->curve_shape == CURVE_RIBBON) { + curve_system_manager->primitive = CURVE_RIBBONS; + curve_system_manager->use_backfacing = false; + } } if(curve_system_manager->modified_mesh(prev_curve_system_manager)) { |