mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Make the concept of namespaces explicit in dynamic attributes
This is in order to reduce the likelihood of naming clashes, make it easier to filter in/out attributes, ensure uniformity, etc. All dynattrs in the opensim distro itself or likely future ones should be in the "OpenSim" namespace. This does alter the underlying dynattrs data structure. All data in previous structures may not be available, though old structures should not cause errors. This is done without notice since this feature has been explicitly labelled as experimental, subject to change and has not been in a release. However, existing materials data is being preserved by moving it to the "Materials" store in the "OpenSim" namespace.
This commit is contained in:
@@ -1290,7 +1290,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
if (sop.MediaUrl != null)
|
||||
writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString());
|
||||
|
||||
if (sop.DynAttrs.Count > 0)
|
||||
if (sop.DynAttrs.CountNamespaces > 0)
|
||||
{
|
||||
writer.WriteStartElement("DynAttrs");
|
||||
sop.DynAttrs.WriteXml(writer);
|
||||
|
||||
@@ -212,7 +212,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gather all of the texture asset UUIDs used to reference "Materials" such as normal and specular maps
|
||||
/// </summary>
|
||||
@@ -221,20 +220,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void GatherMaterialsUuids(SceneObjectPart part, IDictionary<UUID, AssetType> assetUuids)
|
||||
{
|
||||
// scan thru the dynAttrs map of this part for any textures used as materials
|
||||
OSDMap OSMaterials = null;
|
||||
OSD osdMaterials = null;
|
||||
|
||||
lock (part.DynAttrs)
|
||||
{
|
||||
if (part.DynAttrs.ContainsKey("OS:Materials"))
|
||||
OSMaterials = part.DynAttrs["OS:Materials"];
|
||||
if (OSMaterials != null && OSMaterials.ContainsKey("Materials"))
|
||||
if (part.DynAttrs.ContainsStore("OpenSim", "Materials"))
|
||||
{
|
||||
OSDMap materialsStore = part.DynAttrs.GetStore("OpenSim", "Materials");
|
||||
materialsStore.TryGetValue("Materials", out osdMaterials);
|
||||
}
|
||||
|
||||
if (osdMaterials != null)
|
||||
{
|
||||
OSD osd = OSMaterials["Materials"];
|
||||
//m_log.Info("[UUID Gatherer]: found Materials: " + OSDParser.SerializeJsonString(osd));
|
||||
|
||||
if (osd is OSDArray)
|
||||
if (osdMaterials is OSDArray)
|
||||
{
|
||||
OSDArray matsArr = osd as OSDArray;
|
||||
OSDArray matsArr = osdMaterials as OSDArray;
|
||||
foreach (OSDMap matMap in matsArr)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user