diff options
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 29 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 11 | ||||
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 10 |
3 files changed, 42 insertions, 8 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index ac0a1d7bdb7..b0e0baf4057 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -71,6 +71,7 @@ enum_curve_presets = ( ('TRUE_NORMAL', "True Normal", "Use true normals with line segments(good for thin strands)"), ('ACCURATE_PRESET', "Accurate", "Use best line segment settings (suitable for glass materials)"), ('SMOOTH_CURVES', "Smooth Curves", "Use smooth cardinal curves (slowest)"), + ('SMOOTH_RIBBONS', "Ribbons", "Use smooth cardinal curves without thickness"), ) enum_curve_primitives = ( @@ -745,11 +746,23 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup): min=0, max=100.0, default=1.01, ) + cls.minimum_width = FloatProperty( + name="Minimal width", + description="Minimal pixel width for strands (0 - deactivated)", + min=0, max=100, + default=0.0, + ) + cls.maximum_width = FloatProperty( + name="Maximal width", + description="Maximum extension that strand radius can be increased by", + min=0, max=100, + default=0.1, + ) cls.subdivisions = IntProperty( name="Subdivisions", description="Number of subdivisions used in Cardinal curve intersection (power of 2)", min=0, max=24, - default=3, + default=4, ) @classmethod @@ -765,15 +778,21 @@ class CyclesCurveSettings(bpy.types.PropertyGroup): description="Cycles hair settings", type=cls, ) + cls.radius_scale = FloatProperty( + name="Radius Scaling", + description="Multiplier of width properties", + min=0.0, max=1000.0, + default=0.01, + ) cls.root_width = FloatProperty( - name="Root Size Multiplier", - description="Multiplier of particle size for the strand's width at root", + name="Root Size", + description="Strand's width at root", min=0.0, max=1000.0, default=1.0, ) cls.tip_width = FloatProperty( - name="Tip Size Multiplier", - description="Multiplier of particle size for the strand's width at tip", + name="Tip Multiplier", + description="Strand's width at tip", min=0.0, max=1000.0, default=0.0, ) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 564a62f257d..92e9c622201 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1079,6 +1079,10 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel): row = layout.row() row.prop(ccscene, "use_parents", text="Include parents") + + row = layout.row() + row.prop(ccscene, "minimum_width", text="Min Pixels") + row.prop(ccscene, "maximum_width", text="Max Ext.") class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel): @@ -1103,12 +1107,15 @@ class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel): row = layout.row() row.prop(cpsys, "shape", text="Shape") - row.prop(cpsys, "use_closetip", text="Close tip") - layout.label(text="Width multiplier:") + layout.label(text="Thickness:") row = layout.row() row.prop(cpsys, "root_width", text="Root") row.prop(cpsys, "tip_width", text="Tip") + + row = layout.row() + row.prop(cpsys, "radius_scale", text="Scaling") + row.prop(cpsys, "use_closetip", text="Close tip") class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel): diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 768a5a6ee3a..4e0aad8ad14 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -195,7 +195,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par CData->psys_curvenum.push_back(totcurves); CData->psys_shader.push_back(shader); - float radius = b_psys.settings().particle_size() * 0.5f; + float radius = get_float(cpsys, "radius_scale") * 0.5f; CData->psys_rootradius.push_back(radius * get_float(cpsys, "root_width")); CData->psys_tipradius.push_back(radius * get_float(cpsys, "tip_width")); @@ -884,6 +884,8 @@ void BlenderSync::sync_curve_settings() CurveSystemManager prev_curve_system_manager = *curve_system_manager; curve_system_manager->use_curves = get_boolean(csscene, "use_curves"); + curve_system_manager->minimum_width = get_float(csscene, "minimum_width"); + curve_system_manager->maximum_width = get_float(csscene, "maximum_width"); if(preset == CURVE_CUSTOM) { /*custom properties*/ @@ -957,6 +959,12 @@ void BlenderSync::sync_curve_settings() curve_system_manager->use_backfacing = true; curve_system_manager->subdivisions = 4; break; + case CURVE_SMOOTH_RIBBONS: + /*Cardinal ribbons preset*/ + curve_system_manager->primitive = CURVE_RIBBONS; + curve_system_manager->use_backfacing = false; + curve_system_manager->subdivisions = 4; + break; } } |