<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://osimdev.org/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenSimulator_Internals%2FWalkthroughs%2FAvatar_Rezzes_Box</id>
	<title>OpenSimulator Internals/Walkthroughs/Avatar Rezzes Box - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://osimdev.org/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenSimulator_Internals%2FWalkthroughs%2FAvatar_Rezzes_Box"/>
	<link rel="alternate" type="text/html" href="http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Walkthroughs/Avatar_Rezzes_Box&amp;action=history"/>
	<updated>2026-08-04T15:37:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Walkthroughs/Avatar_Rezzes_Box&amp;diff=103&amp;oldid=prev</id>
		<title>Jwbshaw: first</title>
		<link rel="alternate" type="text/html" href="http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Walkthroughs/Avatar_Rezzes_Box&amp;diff=103&amp;oldid=prev"/>
		<updated>2026-07-07T22:39:12Z</updated>

		<summary type="html">&lt;p&gt;first&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= OpenSimulator Internals/Walkthroughs/Avatar Rezzes Box =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Traces what happens in code, connectors, and database when an avatar rezzes a simple object (a box) from inventory into the world, then puts a notecard inside it. Uses live data from the osimdev T1 region database to illustrate the actual DB state.&lt;br /&gt;
&lt;br /&gt;
This is a concrete instance of [[OpenSimulator Internals/Walkthroughs/Avatar Rezzes Inventory]]. Read that page for the full code path. This page focuses on the DB state before and after.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Setup: What Was in the Database Before ==&lt;br /&gt;
&lt;br /&gt;
Before the box was rezzed, osimdev T1 contained 7 objects (471 prims). After rezzing the box and adding a notecard:&lt;br /&gt;
&lt;br /&gt;
From live query (WHERE UUID = SceneGroupID to get root prim names):&lt;br /&gt;
&lt;br /&gt;
 SceneGroupID                          prim_count  root_name&lt;br /&gt;
 a4cbde76-...                          193         CASA 3 (large house)&lt;br /&gt;
 da990c49-...                          181         Brown House&lt;br /&gt;
 ed13b4e9-...                           54         4 chair set&lt;br /&gt;
 ef6cc0c0-...                           36         Athena Bento BoM Mesh Body 6.5&lt;br /&gt;
 d78b8ebf-...                            5         Brown House Sculpts&lt;br /&gt;
 1285d009-...                            1         Sofa_1_N150911kompleet&lt;br /&gt;
 746c1d97-...                            1         Object (cube)&lt;br /&gt;
 789a253a-...                            1         Box&lt;br /&gt;
&lt;br /&gt;
Note: the original query used MIN(Name) GROUP BY SceneGroupID which returned child prim names (&amp;quot;171800&amp;quot;, &amp;quot;171801&amp;quot; etc.) for the Athena HUD instead of the root prim name. The correct query uses WHERE UUID = SceneGroupID. See WTF file.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 1. Rezzing the Box ==&lt;br /&gt;
&lt;br /&gt;
Avatar drags &amp;quot;Box&amp;quot; from inventory to the world.&lt;br /&gt;
&lt;br /&gt;
Scene.RezObject() → BasicInventoryAccessModule.RezObject():&lt;br /&gt;
# InventoryService.GetItem() -- fetches the box&amp;#039;s inventory record from inventoryitems table.&lt;br /&gt;
# AssetService.Get(assetID) -- fetches the serialised object XML from assets table.&lt;br /&gt;
# Scene.GetObjectsToRez() -- deserialises XML into SceneObjectGroup (1 prim).&lt;br /&gt;
# GetNewRezLocation() -- raycasts to ground surface for position.&lt;br /&gt;
# DoPreRezWhenFromItem() -- sets name/description, links FromUserInventoryItemID if copyable.&lt;br /&gt;
# Scene.AddNewSceneObject() -- adds to scene graph.&lt;br /&gt;
# SimulationDataService.StoreObject() called immediately on add -- writes prim to DB.&lt;br /&gt;
# CreateScriptInstances() -- no scripts in a plain box, so no-op.&lt;br /&gt;
# Schedules full update to all clients.&lt;br /&gt;
&lt;br /&gt;
; DB reads:&lt;br /&gt;
* inventoryitems -- SELECT: box item record&lt;br /&gt;
* assets -- SELECT: object XML asset&lt;br /&gt;
&lt;br /&gt;
; DB writes (immediate on AddNewSceneObject):&lt;br /&gt;
* prims -- INSERT: 1 row (UUID, SceneGroupID = same UUID for root, Name=&amp;quot;Box&amp;quot;, GroupPositionX/Y/Z, etc.)&lt;br /&gt;
* primshapes -- INSERT: 1 row (shape data: PCode=9 box, ProfileShape=0, etc.)&lt;br /&gt;
&lt;br /&gt;
; DB writes (on next backup cycle, ~18s later):&lt;br /&gt;
* prims -- UPDATE: position/state confirmed&lt;br /&gt;
* primitems -- INSERT: empty (no task inventory yet)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 2. Putting the Notecard in the Box ==&lt;br /&gt;
&lt;br /&gt;
Avatar opens the box contents and drags a notecard from inventory into it.&lt;br /&gt;
&lt;br /&gt;
This is a task inventory operation, not a world rez:&lt;br /&gt;
&lt;br /&gt;
# Viewer sends UpdateTaskInventory packet.&lt;br /&gt;
# Scene.UpdateTaskInventory() validates permissions.&lt;br /&gt;
# Copies inventory item to object&amp;#039;s task inventory (SceneObjectPart.Inventory).&lt;br /&gt;
# Sets HasGroupChanged = true on the SOG.&lt;br /&gt;
# On next backup cycle: SimulationDataService.StoreObject() writes primitems row.&lt;br /&gt;
&lt;br /&gt;
; DB writes (on next backup cycle):&lt;br /&gt;
* primitems -- INSERT: 1 row (primID = box UUID, name=&amp;quot;Notecard&amp;quot;, assetID = notecard asset UUID, invType=7, assetType=7, etc.)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 3. DB State After ==&lt;br /&gt;
&lt;br /&gt;
prims table: 1 new row for the box root prim.&lt;br /&gt;
primshapes table: 1 new row.&lt;br /&gt;
primitems table: 1 new row for the notecard inside the box.&lt;br /&gt;
&lt;br /&gt;
The notecard asset itself (the text content) lives in the assets table -- it was already there from when the notecard was written. The primitems row references it by assetID.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 4. What the DB Rows Look Like ==&lt;br /&gt;
&lt;br /&gt;
prims row (key fields):&lt;br /&gt;
* UUID -- unique prim UUID&lt;br /&gt;
* SceneGroupID -- same as UUID for root prim; child prims have root&amp;#039;s UUID here&lt;br /&gt;
* RegionUUID -- T1 region UUID&lt;br /&gt;
* Name -- &amp;quot;Box&amp;quot;&lt;br /&gt;
* GroupPositionX/Y/Z -- world position&lt;br /&gt;
* OwnerID -- avatar UUID&lt;br /&gt;
* CreatorID -- avatar UUID&lt;br /&gt;
* BaseMask, OwnerMask, EveryoneMask, GroupMask, NextOwnerMask -- permissions&lt;br /&gt;
* ScriptAccessPin -- 0 (no scripts)&lt;br /&gt;
* RotationX/Y/Z/W -- orientation quaternion&lt;br /&gt;
&lt;br /&gt;
primshapes row (key fields):&lt;br /&gt;
* UUID -- same as prim UUID&lt;br /&gt;
* PCode -- 9 (primitive)&lt;br /&gt;
* ProfileShape -- 0 (square/box)&lt;br /&gt;
* HollowShape -- 0&lt;br /&gt;
* ScaleX/Y/Z -- 0.5, 0.5, 0.5 (default half-metre cube)&lt;br /&gt;
* PathBegin/PathEnd -- 0/1 (full path)&lt;br /&gt;
* ProfileBegin/ProfileEnd -- 0/1 (full profile)&lt;br /&gt;
&lt;br /&gt;
primitems row (key fields, after notecard added):&lt;br /&gt;
* itemID -- unique UUID for this task inventory entry&lt;br /&gt;
* primID -- box prim UUID&lt;br /&gt;
* assetID -- notecard asset UUID&lt;br /&gt;
* name -- notecard name&lt;br /&gt;
* description -- notecard description&lt;br /&gt;
* invType -- 7 (notecard)&lt;br /&gt;
* assetType -- 7 (notecard)&lt;br /&gt;
* creatorID -- avatar UUID&lt;br /&gt;
* ownerID -- avatar UUID&lt;br /&gt;
* BaseMask/CurrentMask/etc. -- permissions&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[OpenSimulator Internals/Walkthroughs]]&lt;br /&gt;
* [[OpenSimulator Internals/Walkthroughs/Avatar Rezzes Inventory]]&lt;br /&gt;
* [[OpenSimulator Internals/Walkthroughs/Avatar Derezzes Object]]&lt;br /&gt;
* [[OpenSimulator Internals/Code Map/InventoryAccessModule]]&lt;br /&gt;
* [[OpenSimulator Internals/Databases]]&lt;/div&gt;</summary>
		<author><name>Jwbshaw</name></author>
	</entry>
</feed>