Asset Formats

From OpenSimulator

Revision as of 17:02, 6 January 2012 by Justincc (Talk | contribs)

Jump to: navigation, search

Contents

Introduction

There are many asset types in OpenSimulator (e.g. notecards, sounds, textures). Each of these has its own distinctive format.

On the whole, asset formats are identical to those used by the Second Life system, since they need to be sent to and understood by a second life client. However, some are unique to OpenSimulator, in particular the object/prim serialization format.

Object/prim serialization formats

There are currently two object formats in OpenSimulator - 'xml' and 'xml2'. These are semantically identical and physically almost identical - by a sad quirk of fate slightly different formats are used for different purposes (e.g. serialization to asset store and storage in OAR files).

In addition, these formats evolved out of the automatic serialization of the internal SceneObjectGroup and SceneObjectPart objects (hence the names). This means that they contain some cryptic and redundant information.

XML format

Here's an example

<SceneObjectGroup>
  <RootPart>
    <SceneObjectPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <AllowedDrop>false</AllowedDrop>
      <CreatorID>
        <UUID>57956c4b-ff2e-4fc1-9995-613c6256cc98</UUID>
      </CreatorID>
      <FolderID>
        <UUID>b06d2e45-650e-4e5d-a08a-b03a6dd67bff</UUID>
      </FolderID>
      <InventorySerial>0</InventorySerial>
      <UUID>
        <UUID>b06d2e45-650e-4e5d-a08a-b03a6dd67bff</UUID>
      </UUID>
      <LocalId>2094307979</LocalId>
      <Name>Companion cube</Name>
      <Material>3</Material>
      <PassTouches>false</PassTouches>
      <RegionHandle>1099511628032000</RegionHandle>
      <ScriptAccessPin>0</ScriptAccessPin>
      <GroupPosition>
        <X>81.85081</X>
        <Y>157.5245</Y>
        <Z>21.32862</Z>
      </GroupPosition>
      <OffsetPosition>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </OffsetPosition>
      <RotationOffset>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
        <W>1</W>
      </RotationOffset>
      <Velocity>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </Velocity>
      <AngularVelocity>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </AngularVelocity>
      <Acceleration>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </Acceleration>
      <Description/>
      <Color>
        <R>0</R>
        <G>0</G>
        <B>0</B>
        <A>255</A>
      </Color>
      <Text/>
      <SitName/>
      <TouchName/>
      <LinkNum>0</LinkNum>
      <ClickAction>0</ClickAction>
      <Shape>
        <ProfileCurve>1</ProfileCurve>
        <TextureEntry>iVVnRyTLQ+2SC0fK7RVGXwAAAAAAAAAAgD8AAACAPwAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
        <ExtraParams>AA==</ExtraParams>
        <PathBegin>0</PathBegin>
        <PathCurve>16</PathCurve>
        <PathEnd>0</PathEnd>
        <PathRadiusOffset>0</PathRadiusOffset>
        <PathRevolutions>0</PathRevolutions>
        <PathScaleX>100</PathScaleX>
        <PathScaleY>100</PathScaleY>
        <PathShearX>0</PathShearX>
        <PathShearY>0</PathShearY>
        <PathSkew>0</PathSkew>
        <PathTaperX>0</PathTaperX>
        <PathTaperY>0</PathTaperY>
        <PathTwist>0</PathTwist>
        <PathTwistBegin>0</PathTwistBegin>
        <PCode>9</PCode>
        <ProfileBegin>0</ProfileBegin>
        <ProfileEnd>0</ProfileEnd>
        <ProfileHollow>0</ProfileHollow>
        <State>0</State>
        <ProfileShape>Square</ProfileShape>
        <HollowShape>Same</HollowShape>
        <SculptTexture>
          <UUID>00000000-0000-0000-0000-000000000000</UUID>
        </SculptTexture>
        <SculptType>0</SculptType>
        <SculptData/>
        <FlexiSoftness>0</FlexiSoftness>
        <FlexiTension>0</FlexiTension>
        <FlexiDrag>0</FlexiDrag>
        <FlexiGravity>0</FlexiGravity>
        <FlexiWind>0</FlexiWind>
        <FlexiForceX>0</FlexiForceX>
        <FlexiForceY>0</FlexiForceY>
        <FlexiForceZ>0</FlexiForceZ>
        <LightColorR>0</LightColorR>
        <LightColorG>0</LightColorG>
        <LightColorB>0</LightColorB>
        <LightColorA>1</LightColorA>
        <LightRadius>0</LightRadius>
        <LightCutoff>0</LightCutoff>
        <LightFalloff>0</LightFalloff>
        <LightIntensity>1</LightIntensity>
        <FlexiEntry>false</FlexiEntry>
        <LightEntry>false</LightEntry>
        <SculptEntry>false</SculptEntry>
      </Shape>
      <Scale>
        <X>0.5</X>
        <Y>0.5</Y>
        <Z>0.5</Z>
      </Scale>
      <SitTargetOrientation>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
        <W>1</W>
      </SitTargetOrientation>
      <SitTargetPosition>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </SitTargetPosition>
      <SitTargetPositionLL>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </SitTargetPositionLL>
      <SitTargetOrientationLL>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
        <W>1</W>
      </SitTargetOrientationLL>
      <ParentID>0</ParentID>
      <CreationDate>1325896997</CreationDate>
      <Category>0</Category>
      <SalePrice>0</SalePrice>
      <ObjectSaleType>0</ObjectSaleType>
      <OwnershipCost>0</OwnershipCost>
      <GroupID>
        <UUID>00000000-0000-0000-0000-000000000000</UUID>
      </GroupID>
      <OwnerID>
        <UUID>57956c4b-ff2e-4fc1-9995-613c6256cc98</UUID>
      </OwnerID>
      <LastOwnerID>
        <UUID>57956c4b-ff2e-4fc1-9995-613c6256cc98</UUID>
      </LastOwnerID>
      <BaseMask>2147483647</BaseMask>
      <OwnerMask>2147483647</OwnerMask>
      <GroupMask>0</GroupMask>
      <EveryoneMask>0</EveryoneMask>
      <NextOwnerMask>2147483647</NextOwnerMask>
      <Flags>None</Flags>
      <CollisionSound>
        <UUID>00000000-0000-0000-0000-000000000000</UUID>
      </CollisionSound>
      <CollisionSoundVolume>0</CollisionSoundVolume>
      <TextureAnimation/>
      <ParticleSystem/>
      <PayPrice0>-2</PayPrice0>
      <PayPrice1>-2</PayPrice1>
      <PayPrice2>-2</PayPrice2>
      <PayPrice3>-2</PayPrice3>
      <PayPrice4>-2</PayPrice4>
    </SceneObjectPart>
  </RootPart>
  <OtherParts/>
</SceneObjectGroup>

Explanation

<SceneObjectGroup> - Each object in OpenSimulator is a group of prims, otherwise known as a link set.

<RootPart> - One prim is always the root prim (here referred to as the root part. Other prims will be in the OtherParts section but will have exactly the same format as the root SceneObjectPart.

<SceneObjectPart> - This contains all the individual prim properties.

XML2 format

Here's the same object as above, but in 'XML2' format. As you can see, the format is identical except that there is no <RootPart> tag around the root part - it is assumed to be simply the first part instead.

<SceneObjectGroup>
  <SceneObjectPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <AllowedDrop>false</AllowedDrop>
    <CreatorID>
      <UUID>57956c4b-ff2e-4fc1-9995-613c6256cc98</UUID>
    </CreatorID>
    <FolderID>
      <UUID>b06d2e45-650e-4e5d-a08a-b03a6dd67bff</UUID>
    </FolderID>
    <InventorySerial>0</InventorySerial>
    <UUID>
      <UUID>b06d2e45-650e-4e5d-a08a-b03a6dd67bff</UUID>
    </UUID>
    <LocalId>2094307979</LocalId>
    <Name>Companion cube</Name>
    <Material>3</Material>
    <PassTouches>false</PassTouches>
    <RegionHandle>1099511628032000</RegionHandle>
    <ScriptAccessPin>0</ScriptAccessPin>
    <GroupPosition>
      <X>81.85081</X>
      <Y>157.5245</Y>
      <Z>21.32862</Z>
    </GroupPosition>
    <OffsetPosition>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
    </OffsetPosition>
    <RotationOffset>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
      <W>1</W>
    </RotationOffset>
    <Velocity>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
    </Velocity>
    <AngularVelocity>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
    </AngularVelocity>
    <Acceleration>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
    </Acceleration>
    <Description/>
    <Color>
      <R>0</R>
      <G>0</G>
      <B>0</B>
      <A>255</A>
    </Color>
    <Text/>
    <SitName/>
    <TouchName/>
    <LinkNum>0</LinkNum>
    <ClickAction>0</ClickAction>
    <Shape>
      <ProfileCurve>1</ProfileCurve>
      <TextureEntry>iVVnRyTLQ+2SC0fK7RVGXwAAAAAAAAAAgD8AAACAPwAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
      <ExtraParams>AA==</ExtraParams>
      <PathBegin>0</PathBegin>
      <PathCurve>16</PathCurve>
      <PathEnd>0</PathEnd>
      <PathRadiusOffset>0</PathRadiusOffset>
      <PathRevolutions>0</PathRevolutions>
      <PathScaleX>100</PathScaleX>
      <PathScaleY>100</PathScaleY>
      <PathShearX>0</PathShearX>
      <PathShearY>0</PathShearY>
      <PathSkew>0</PathSkew>
      <PathTaperX>0</PathTaperX>
      <PathTaperY>0</PathTaperY>
      <PathTwist>0</PathTwist>
      <PathTwistBegin>0</PathTwistBegin>
      <PCode>9</PCode>
      <ProfileBegin>0</ProfileBegin>
      <ProfileEnd>0</ProfileEnd>
      <ProfileHollow>0</ProfileHollow>
      <State>0</State>
      <ProfileShape>Square</ProfileShape>
      <HollowShape>Same</HollowShape>
      <SculptTexture>
        <UUID>00000000-0000-0000-0000-000000000000</UUID>
      </SculptTexture>
      <SculptType>0</SculptType>
      <SculptData/>
      <FlexiSoftness>0</FlexiSoftness>
      <FlexiTension>0</FlexiTension>
      <FlexiDrag>0</FlexiDrag>
      <FlexiGravity>0</FlexiGravity>
      <FlexiWind>0</FlexiWind>
      <FlexiForceX>0</FlexiForceX>
      <FlexiForceY>0</FlexiForceY>
      <FlexiForceZ>0</FlexiForceZ>
      <LightColorR>0</LightColorR>
      <LightColorG>0</LightColorG>
      <LightColorB>0</LightColorB>
      <LightColorA>1</LightColorA>
      <LightRadius>0</LightRadius>
      <LightCutoff>0</LightCutoff>
      <LightFalloff>0</LightFalloff>
      <LightIntensity>1</LightIntensity>
      <FlexiEntry>false</FlexiEntry>
      <LightEntry>false</LightEntry>
      <SculptEntry>false</SculptEntry>
    </Shape>
    <Scale>
      <X>0.5</X>
      <Y>0.5</Y>
      <Z>0.5</Z>
    </Scale>
    <SitTargetOrientation>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
      <W>1</W>
    </SitTargetOrientation>
    <SitTargetPosition>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
    </SitTargetPosition>
    <SitTargetPositionLL>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
    </SitTargetPositionLL>
    <SitTargetOrientationLL>
      <X>0</X>
      <Y>0</Y>
      <Z>0</Z>
      <W>1</W>
    </SitTargetOrientationLL>
    <ParentID>0</ParentID>
    <CreationDate>1325896997</CreationDate>
    <Category>0</Category>
    <SalePrice>0</SalePrice>
    <ObjectSaleType>0</ObjectSaleType>
    <OwnershipCost>0</OwnershipCost>
    <GroupID>
      <UUID>00000000-0000-0000-0000-000000000000</UUID>
    </GroupID>
    <OwnerID>
      <UUID>57956c4b-ff2e-4fc1-9995-613c6256cc98</UUID>
    </OwnerID>
    <LastOwnerID>
      <UUID>57956c4b-ff2e-4fc1-9995-613c6256cc98</UUID>
    </LastOwnerID>
    <BaseMask>2147483647</BaseMask>
    <OwnerMask>2147483647</OwnerMask>
    <GroupMask>0</GroupMask>
    <EveryoneMask>0</EveryoneMask>
    <NextOwnerMask>2147483647</NextOwnerMask>
    <Flags>None</Flags>
    <CollisionSound>
      <UUID>00000000-0000-0000-0000-000000000000</UUID>
    </CollisionSound>
    <CollisionSoundVolume>0</CollisionSoundVolume>
    <TextureAnimation/>
    <ParticleSystem/>
    <PayPrice0>-2</PayPrice0>
    <PayPrice1>-2</PayPrice1>
    <PayPrice2>-2</PayPrice2>
    <PayPrice3>-2</PayPrice3>
    <PayPrice4>-2</PayPrice4>
  </SceneObjectPart>
  <OtherParts/>
</SceneObjectGroup>
Personal tools
General
About This Wiki