- Joined
- Sep 20, 2018
- Messages
- 3,998
(Based on GLTF Overrides, dealing with gltf texturing, PBM, and all that). You can't just use llSetAlpha() over ALL_SIDES any more with mesh, it's gotten more involved. This probably also applies to normal prims with materials assigned as well.
For normal prims with material rendering, take this AI note into consideration:
To determine if a prim face has a render material assigned, use llGetRenderMaterial or llGetPrimitiveParams with the PRIM_RENDER_MATERIAL flag. These functions return the name or UUID of the material on a specific face, or NULL_KEY if no material is applied.
Script assumes mesh is a child in a linkset. If used with a standalone mesh object, replace the variable ln with ... llGetLinkNumber() ... I think, and add some touch code to fire it off.
For normal prims with material rendering, take this AI note into consideration:
To determine if a prim face has a render material assigned, use llGetRenderMaterial or llGetPrimitiveParams with the PRIM_RENDER_MATERIAL flag. These functions return the name or UUID of the material on a specific face, or NULL_KEY if no material is applied.
Script assumes mesh is a child in a linkset. If used with a standalone mesh object, replace the variable ln with ... llGetLinkNumber() ... I think, and add some touch code to fire it off.
Code:
show_mesh(integer ln, integer visible)
{
float alpha = 0.0;
list toDo;
list transforms = llGetLinkPrimitiveParams(
ln, [PRIM_GLTF_BASE_COLOR,ALL_SIDES]
);
list repeats = llList2ListSlice(
transforms,0,-1,9,1
);
list offsets = llList2ListSlice(
transforms,0,-1,9,2
);
integer faceCount = llGetLinkNumberOfSides(ln);
integer i;
for(; i < faceCount; ++i) {
toDo += [PRIM_GLTF_BASE_COLOR, i, "",
llList2Vector(repeats,i),
llList2Vector(offsets,i), "", ""
];
toDo += llList2ListSlice(
["",alpha,"", PRIM_GLTF_ALPHA_MODE_BLEND],
0,-1,2,visible
);
toDo += ["", ""];
}
llSetLinkPrimitiveParamsFast(ln,toDo);
llSay(
0, "Making surfaces "
+ llList2String(["default","transparent"],visible
));
}
[/showcode]
Last edited: