From f7d09b898ad6df32b3f07cb64657623980178c2f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 27 Jun 2013 23:14:28 +0100 Subject: 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. --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/UuidGatherer.cs') diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 0e83781..586b59d 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -212,7 +212,6 @@ namespace OpenSim.Region.Framework.Scenes // } // } - /// /// Gather all of the texture asset UUIDs used to reference "Materials" such as normal and specular maps /// @@ -221,20 +220,23 @@ namespace OpenSim.Region.Framework.Scenes public void GatherMaterialsUuids(SceneObjectPart part, IDictionary 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 -- cgit v1.1