GLTF Overrides does not work the same way as plain textures
tracked
Tempus Heart
So when having a texture with limited permissions, you can use this texture to texture objects, with the plain texture system (Blinn-Phong), but not with GLTF Overrides. It does not work in the object editor and it does not work through scripts. I have been trying to set a no transfer texture as a PRIM_GLTF_BASE_COLOR with llSetPrimitiveParams through LSL, but it throws a permission error. In the editor, it is simply not possible to place the texture in the slot for the selected texture face.
Now I assume that they are supposed to work like plain textures (Blinn-Phong), based on this quote by Brad Linden:
[2024/07/09 12:13:41] Brad Linden: the PBR texture UUID permissions should follow existing patterns for how plain texture UUIDs work in LSL.
That would mean that it's not working as intended. The full video from where this statement is taken can be watched here (Thanks Kristy Aurelia for providing this).
Log In
Tempus Heart
Okay, I guess your example of unlinking makes sense and it does work with old llSPP, so I got something to work with for my project.
Maestro Linden
tracked
Tempus Heart
integer switch = 1;
default
{
touch_start(integer total_number)
{
if(switch == 1)
{
llSetLinkRenderMaterial(LINK_THIS, "15d4063d-cfcc-c167-22e7-da1731d5b6ad", 0);
llSetPrimitiveParams([PRIM_GLTF_BASE_COLOR, 0, "no-trans texture", <1,1,0>, ZERO_VECTOR, 0, <0,1,0>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.0, FALSE]);
switch = 2;
}
else if(switch == 2)
{
llSetLinkRenderMaterial(LINK_THIS, "15d4063d-cfcc-c167-22e7-da1731d5b6ad", 1);
llSetLinkPrimitiveParams(LINK_THIS, [PRIM_GLTF_BASE_COLOR, 1, "no-trans texture", <1,1,0>, ZERO_VECTOR, 0, <0,0,1>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.0, FALSE]);
switch = 3;
}
else if(switch == 3)
{
llSetLinkRenderMaterial(LINK_THIS, "15d4063d-cfcc-c167-22e7-da1731d5b6ad", 2);
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLTF_BASE_COLOR, 2, "no-trans texture", <1,1,0>, ZERO_VECTOR, 0, <1,0,0>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.0, FALSE]);
switch = 1;
}
}
}
Maestro Linden
Tempus Heart: Thanks for the script. I see the issue with my failure to repro with llSetLinkPrimitiveParamsFast() - there was a rogue line in my test script that overwrote
texture_name
with a UUID.Anyway, I can confirm with your repro script that the 'Texture not transferable' error appears with both llSetLinkPrimitiveParamsFast and llSetLinkPrimitiveParams. See the script in my child comment - it sets the GLTF override successfully on face 0 with using llSetPrimitiveParams, but hits the permissions error with llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast on faces 1 and 2. _However_ , it also fails to set the PRIM_TEXTURE on face 3, due to the same permissions error.
The reason for the error message with linkset-scale llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast operations is to prevent this scenario:
- 2-prim full-perm linkset rezzed
- User puts "no trans texture" in link 1. Linkset becomes no-transfer due to presence of "no trans texture" in link 1.
- Script calls llSetLinkPrimitiveParams(2, [PRIM_TEXTURE, ALL_SIDES, "no trans texture", ...])to apply the texture to link #2
- Linkset unlinked via the build tool. Link #1 is still no-transfer due to the inventory item, but link #2 with "no trans texture" texture on its faces is full-permission (oops!)
For our 1-prim test script, there wouldn't be a permissions exploit anyway, since we're applying the texture to LINK_THIS. The permissions check doesn't consider if the prim being updated is also prim that the script and no-transfer texture are in. There is an existing issue describing this scenario:
Maestro Linden
/* Repro script:
llSetPrimitiveParams is able to set "no-trans texture" as GLTF override on face 0
llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast fail to set the same GLTF override on faces 1 & 2
llSetLinkPrimitiveParamsFast also fails to set the "no-trans texture" on face 3 due to the same issue
*/
default
{
state_entry()
{
key base_material = "15d4063d-cfcc-c167-22e7-da1731d5b6ad";
llSetLinkRenderMaterial(LINK_THIS, base_material, 0);
llSetLinkRenderMaterial(LINK_THIS, base_material, 1);
llSetLinkRenderMaterial(LINK_THIS, base_material, 2);
llSay(0, "Material applied to faces 0-2. Touch object to get PRIM_GLTF_BASE_COLOR override "
+ " on faces 0-2 using different methods, along with PRIM_TEXTURE change on face 3");
}
touch_start(integer total_number)
{
string texture_name = "no-trans texture";
integer face = 0;
list gltf_common = [texture_name, <1,1,0>, ZERO_VECTOR, 0,
<1,1,1>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.0, FALSE];
llSay(DEBUG_CHANNEL, "Using llSetPrimitiveParams to set PRIM_GLTF_BASE_COLOR override override on face "
+ (string)face + " to '" + texture_name + "' in prim inventory...");
llSetPrimitiveParams([PRIM_GLTF_BASE_COLOR, face] + gltf_common);
llSleep(5);
face = 1;
llSay(DEBUG_CHANNEL, "Using llSetLinkPrimitiveParams to set PRIM_GLTF_BASE_COLOR override on face "
+ (string)face + " to '" + texture_name + "' in prim inventory...");
llSetLinkPrimitiveParams(LINK_THIS, [PRIM_GLTF_BASE_COLOR, face] + gltf_common);
llSleep(5);
face = 2;
llSay(DEBUG_CHANNEL, "Using llSetLinkPrimitiveParamsFast to set PRIM_GLTF_BASE_COLOR override on face "
+ (string)face + " to '" + texture_name + "' in prim inventory...");
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLTF_BASE_COLOR, face] + gltf_common);
llSleep(5);
face = 3;
llSay(DEBUG_CHANNEL, "Using llSetLinkPrimitiveParamsFast to set PRIM_TEXTURE on face "
+ (string)face + " to '" + texture_name + "' in prim inventory...");
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, face, texture_name, <1,1,0>, ZERO_VECTOR, 0]);
}
}
Tempus Heart
Actually it only seems to apply to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast after testing your script.
Maestro Linden
Tempus Heart: Please post a version of the script which reproduces this issue. I still see the expected behavior when I modify the touch_start call to be:
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLTF_BASE_COLOR, 0, texture_name, <1,1,0>, ZERO_VECTOR, 0, <1,1,1>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.0, FALSE]);
Maestro Linden
needs info
Can you post the script in question?
Setting a GLTF override to a no-transfer PRIM_GLTF_BASE_COLOR map in prim inventory is working for me. The no-transfer texture's UUID will generally be obfuscated, but it can also be referenced by the name of the item in prim inventory. In my example, the "no transfer" texture is named "no-trans texture":
default
{
state_entry()
{
llSetLinkRenderMaterial(LINK_THIS, "15d4063d-cfcc-c167-22e7-da1731d5b6ad", 0);
llSay(0, "Material applied. Touch object to get PRIM_GLTF_BASE_COLOR override on face 0.");
}
touch_start(integer total_number)
{
string texture_name = "no-trans texture";
texture_name = "df74a59d-77d3-4e05-408d-de19a4d2f49d";
llSay(0, "Setting base color to to '" + texture_name + "' in prim inventory...");
llSetPrimitiveParams([PRIM_GLTF_BASE_COLOR, 0, texture_name, <1,1,0>, ZERO_VECTOR, 0,
<1,1,1>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.0, FALSE]);
}
}
Cain Maven
Maestro Linden I can't repro this issue, but I do think that the scripting support for glTF needs a rethink in general.
For one, it seems to be based to a large extent on textures or materials being stored in object inventories? I don't know the reason for this, but it's not likely to be the case in any creation based on large linksets.
Then there's of course the fact that we cannot read all properties of a glTF surface:
I've heard it said that allowing this would create permission issues, but I do not understand what they might be or how that would be a bigger issue than with BP.
So. Any chance LL would like to have a sit-down to work through this and come up with solutions? :)