From 5fe152cfea87c04c1edf2caa7d419a056a7916a2 Mon Sep 17 00:00:00 2001 From: Aqil Ahmad Date: Mon, 6 Oct 2025 18:52:33 +0500 Subject: Fix #4195: Preserve transforms when switching PBR materials (#4725) Fixes texture transforms being reset when switching from Blinn-Phong to PBR materials and between PBR. Previously, custom scale, offset, and rotation settings would be lost, making it tedious to switch between PBR materials. --- indra/llprimitive/llgltfmaterial.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llprimitive/llgltfmaterial.h') diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h index 10df4c8ee1..8d45cb6185 100644 --- a/indra/llprimitive/llgltfmaterial.h +++ b/indra/llprimitive/llgltfmaterial.h @@ -214,6 +214,14 @@ public: bool hasLocalTextures() { return !mTrackingIdToLocalTexture.empty(); } virtual bool replaceLocalTexture(const LLUUID& tracking_id, const LLUUID &old_id, const LLUUID& new_id); virtual void updateTextureTracking(); + + // Convert legacy TE transform values to PBR transform values. + static void convertTextureTransformToPBR(F32 tex_scale_s, F32 tex_scale_t, + F32 tex_offset_s, F32 tex_offset_t, + F32 tex_rotation, + LLVector2& pbr_scale, + LLVector2& pbr_offset, + F32& pbr_rotation); protected: static LLVector2 vec2FromJson(const std::map& object, const char* key, const LLVector2& default_value); static F32 floatFromJson(const std::map& object, const char* key, const F32 default_value); -- cgit v1.3