diff options
author | Stuart Broadfoot <gbroadfoot@hotmail.com> | 2013-01-15 23:44:41 +0400 |
---|---|---|
committer | Stuart Broadfoot <gbroadfoot@hotmail.com> | 2013-01-15 23:44:41 +0400 |
commit | 3373b8154b16d345b0e1fcbdb55d03d8ec088006 (patch) | |
tree | eec2b36ebf0f70ca882a26e6525839c9f7f2013a /intern/cycles/blender | |
parent | 0967b39be1cf9644454e1d4e9c6d0250d9a36e85 (diff) |
Cycles Hair: Introduction of Cardinal Spline Curve Segments and minor fixes.
The curve segment primitive has been added. This includes an intersection function and changes to the BVH.
A few small errors in the line segment intersection routine are also fixed.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 17 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 9 | ||||
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 5 |
3 files changed, 23 insertions, 8 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 8b90b0bd4ff..9dfacf19c81 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -74,13 +74,14 @@ enum_curve_presets = ( enum_curve_primitives = ( ('TRIANGLES', "Triangles", "Create triangle geometry around strands"), ('LINE_SEGMENTS', "Line Segments", "Use line segment primitives"), - ('CURVE_SEGMENTS', "?Curve Segments?", "Use curve segment primitives (not implemented)"), + ('CURVE_SEGMENTS', "Curve Segments", "Use segmented cardinal curve primitives"), + ('CURVE_RIBBONS', "Curve Ribbons", "Use smooth cardinal curve ribbon primitives"), ) enum_triangle_curves = ( - ('CAMERA', "Planes", "Create individual triangles forming planes that face camera"), - ('RIBBONS', "Ribbons", "Create individual triangles forming ribbon"), - ('TESSELLATED', "Tessellated", "Create mesh surrounding each strand"), + ('CAMERA_TRIANGLES', "Planes", "Create individual triangles forming planes that face camera"), + ('RIBBON_TRIANGLES', "Ribbons", "Create individual triangles forming ribbon"), + ('TESSELLATED_TRIANGLES', "Tessellated", "Create mesh surrounding each strand"), ) enum_line_curves = ( @@ -643,7 +644,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup): name="Mesh Geometry", description="Method for creating triangle geometry", items=enum_triangle_curves, - default='CAMERA', + default='CAMERA_TRIANGLES', ) cls.line_method = EnumProperty( name="Intersection Method", @@ -730,6 +731,12 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup): min=0, max=100.0, default=1.01, ) + cls.subdivisions = IntProperty( + name="Subdivisions", + description="Number of subdivisions used in Cardinal curve intersection (power of 2)", + min=0, max=24, + default=3, + ) @classmethod def unregister(cls): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index a24da593b43..9767bd70f46 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -976,7 +976,7 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel): if cscene.primitive == 'TRIANGLES': layout.prop(cscene, "triangle_method", text="Method") - if cscene.triangle_method == 'TESSELLATED': + if cscene.triangle_method == 'TESSELLATED_TRIANGLES': layout.prop(cscene, "resolution", text="Resolution") layout.prop(cscene, "use_smooth", text="Smooth") elif cscene.primitive == 'LINE_SEGMENTS': @@ -997,6 +997,13 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel): row = layout.row() row.prop(cscene, "segments", text="Segments") row.prop(cscene, "normalmix", text="Ray Mix") + elif cscene.primitive == 'CURVE_SEGMENTS' or cscene.primitive == 'CURVE_RIBBONS': + layout.prop(cscene, "subdivisions", text="Curve subdivisions") + layout.prop(cscene, "use_backfacing", text="Check back-faces") + + layout.prop(cscene, "interpolation", text="Interpolation") + row = layout.row() + row.prop(cscene, "segments", text="Segments") row = layout.row() row.prop(cscene, "use_cache", text="Export cache with children") diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 41e1249dae7..f8795ec0a94 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -929,6 +929,7 @@ void BlenderSync::sync_curve_settings() curve_system_manager->resolution = get_int(csscene, "resolution"); curve_system_manager->segments = get_int(csscene, "segments"); curve_system_manager->use_smooth = get_boolean(csscene, "use_smooth"); + curve_system_manager->subdivisions = get_int(csscene, "subdivisions"); curve_system_manager->normalmix = get_float(csscene, "normalmix"); curve_system_manager->encasing_ratio = get_float(csscene, "encasing_ratio"); @@ -1055,11 +1056,11 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool if(primitive == CURVE_TRIANGLES){ int vert_num = mesh->triangles.size() * 3; - if(triangle_method == CURVE_CAMERA) { + if(triangle_method == CURVE_CAMERA_TRIANGLES) { ExportCurveTrianglePlanes(mesh, &CData, interpolation, use_smooth, segments, RotCam); ExportCurveTriangleUVs(mesh, &CData, interpolation, use_smooth, segments, vert_num, 1); } - else if(triangle_method == CURVE_RIBBONS) { + else if(triangle_method == CURVE_RIBBON_TRIANGLES) { ExportCurveTriangleRibbons(mesh, &CData, interpolation, use_smooth, segments); ExportCurveTriangleUVs(mesh, &CData, interpolation, use_smooth, segments, vert_num, 1); } |