Issues with large numbers of PBR Materials in object inventories
needs info
Ember Shuffle
Strange bug a friend and I encountered last night with unpacking PBR materials out of an object inventory resulting in only some of them transferring over, with the inventory fully loaded. Tried different viewers and tried scripted vs. manual unpacking, made no difference.
When opening and unpacking an object inventory that has a large number of PBR materials in it, a lot of the materials will fail to copy over into user inventory. The box was no-modify, and we were trying to unpack a box with 600 materials in it. This also happens in the reverse; dragging and dropping the materials into the object resulted in only between 300 and 500 of them making it into the box.
Curiously, the number that transfers over is very inconsistent, and this seems to happen both with manual unpacking and scripted unpacking.
To reproduce:
- Rez a box.
- Set box to no modify (in case this had something to do with the bug, not sure) or drop a random no-modify script into it for the same purpose.
- Drop a large number of PBR materials into the box.
- Pick up the box.
- Drop the box to simulate a different user going to unpack it
- Try to open and unpack the box. Use an unpacker script and see if it's any different.
Log In
Maestro Linden
needs info
Maestro Linden
I'm not able to reproduce partial inventory copying with this setup:
- Rez 2 boxes and link them together
- Place a material item in the root prim and add the script below to the prim
- Touch the linkset. The script will send 600 copies of the material to the child prim.
- Unlink the boxes, and take the child prim into inventory
- Rez the former child prim again, then right click to 'Open' the former child prim
- Once the items have loaded, click 'Only Copy To Inventory' to copy to inventory
- After copying has completed, click on the folder that was copied in agent inventory. Note the item count for the new folder that was created in agent inventory.
After repeating this a few times, I'm consistently getting all 600 materials. My env is Second Life Release 7.1.10.10800445603 on SLS 2024-11-25.12013542687.
One difference between your test object and mine is that yours presumably has a variety of material assets, while my setup has 600 copies of the same material asset.
Some questions:
- Do you see incomplete copies when following my repro setup? If so, could you let me know about an example region name and timestamp where it triggered for you?
- If my repro setup doesn't trigger the bug for you, could you point me to where I could find your 600+ material-containing object?
default
{
touch_start(integer total_number)
{
integer i;
integer itemsToGive = 600;
for(i = 1; i <= itemsToGive; i++)
{
// give a texture to the child prim
llGiveInventory(llGetLinkKey(2), llGetInventoryName(INVENTORY_MATERIAL, 0));
llSetText("Gave " + (string)i + " out of " + (string)itemsToGive
+ " items to link #2", <1,1,1>, 1);
}
}
}
Ember Shuffle
Maestro Linden
Thanks for your reply!
- I didn't try with multiple linked objects, only the original object with original inventory and attempting to copy into my inventory, or from my inventory into a new object. Each time, it shows less in the resulting inventory.
- For the object in question, it is indeed a box full of unique inventory, seemingly no duplicates. I can send you a copy. I'm Ember.shuffle inworld. c:
- The bug happened in Chonk Box (Sim name CHONK) on the same day as the original post. I just now tried what I did then and had the same result.
- Testing further just now, I tried something else this time:
- Rez original object, open and copy inventory all at once to my inventory. Only 467 made it over to my inventory.
- Rez a new object and drag/drop the copied inventory from me into the new object. Only 380 made it over.
- Copied that new object's inventory into my inventory and only 261 made it over.
- Decided to give your script a try just to see what happens, and for a moment I was stumped to see the following (also attached)
- It seems to move the inventory as intended, however what it actually did was copy the first item in the inventory 600 times (the 0th item, in line 10) so it forced it to show the right number.
I updated the script to the following and got the same results as before:
///////////////
integer LINK_TARG = 2;
SetText( integer l, string t, vector c, float a ) {
llSetLinkPrimitiveParamsFast( l, [ PRIM_TEXT, t, c, a ] );
}
default {
touch_end(integer t) {
integer i;
integer x = llGetInventoryNumber( INVENTORY_MATERIAL );
do {
// Move all FOUND materials to child prim instead of set number.
llGiveInventory(
llGetLinkKey( LINK_TARG ),
llGetInventoryName( INVENTORY_MATERIAL, i )
);
SetText( LINK_THIS, "Gave " + (string)i + " out of " + (string)x + " items to link #" + (string)LINK_TARG + ".", < 1, 1, 1 >, 1 );
} while ( ++i < x );
}
}
///////////////