From 0a0d3678a69b4900cf8c462478047cc04e3fa3f7 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Thu, 16 Oct 2025 15:38:59 +0200 Subject: [PATCH] Cycles: OSL Camera: Use title case for parameters in the UI This is an alternate solution to !146889 to improve labels in the camera UI, while being much less invasive. It doesn't take custom labels into account, but it simply uses the parameter names with title case. Pull Request: https://projects.blender.org/blender/blender/pulls/148141 --- intern/cycles/blender/addon/ui.py | 2 +- scripts/templates_osl/advanced_camera.osl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 1fc2da08bc6..e7bcfa8226d 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1210,7 +1210,7 @@ class CYCLES_CAMERA_PT_lens_custom_parameters(CyclesButtonsPanel, Panel): col = layout.column() for key in ccam.keys(): - col.prop(ccam, f'["{key}"]') + col.prop(ccam, f'["{key}"]', text=bpy.path.display_name(key)) class CYCLES_PT_context_material(CyclesButtonsPanel, Panel): diff --git a/scripts/templates_osl/advanced_camera.osl b/scripts/templates_osl/advanced_camera.osl index f2b004968cd..3ce1d7157e8 100644 --- a/scripts/templates_osl/advanced_camera.osl +++ b/scripts/templates_osl/advanced_camera.osl @@ -35,7 +35,7 @@ shader camera(float focal_length = 50.0 [[ float min = 0.0, float sensitivity = float distortion_k3 = 0.0, float swirl_scale = 100.0, float swirl_amplitude = 0.01, - float swirl_W = 0.0 [[ float sensitivity = 1]], + float swirl_w = 0.0 [[ float sensitivity = 1]], output point position = 0.0, output vector direction = 0.0, output color throughput = 1.0) @@ -59,7 +59,7 @@ shader camera(float focal_length = 50.0 [[ float min = 0.0, float sensitivity = Pcam = Pcam * sensor_size / focal_length; if (do_swirl) { - Pcam += swirl_amplitude * noise("perlin", Pcam * swirl_scale, swirl_W); + Pcam += swirl_amplitude * noise("perlin", Pcam * swirl_scale, swirl_w); } direction = normalize(vector(Pcam.x, Pcam.y, 1.0));