diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/UuidGatherer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 7b47275..e60a025 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -182,7 +182,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
182 | GatherAssetUuids(tii.AssetID, (AssetType)tii.Type, assetUuids); | 182 | GatherAssetUuids(tii.AssetID, (AssetType)tii.Type, assetUuids); |
183 | } | 183 | } |
184 | 184 | ||
185 | // get any texture UUIDs used for materials such as normal and specular maps | 185 | // FIXME: We need to make gathering modular but we cannot yet, since gatherers are not guaranteed |
186 | // to be called with scene objects that are in a scene (e.g. in the case of hg asset mapping and | ||
187 | // inventory transfer. There needs to be a way for a module to register a method without assuming a | ||
188 | // Scene.EventManager is present. | ||
189 | // part.ParentGroup.Scene.EventManager.TriggerGatherUuids(part, assetUuids); | ||
190 | |||
186 | GatherMaterialsUuids(part, assetUuids); | 191 | GatherMaterialsUuids(part, assetUuids); |
187 | } | 192 | } |
188 | catch (Exception e) | 193 | catch (Exception e) |
@@ -208,7 +213,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
208 | // } | 213 | // } |
209 | // } | 214 | // } |
210 | 215 | ||
211 | |||
212 | /// <summary> | 216 | /// <summary> |
213 | /// Gather all of the texture asset UUIDs used to reference "Materials" such as normal and specular maps | 217 | /// Gather all of the texture asset UUIDs used to reference "Materials" such as normal and specular maps |
214 | /// </summary> | 218 | /// </summary> |
@@ -217,20 +221,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
217 | public void GatherMaterialsUuids(SceneObjectPart part, IDictionary<UUID, AssetType> assetUuids) | 221 | public void GatherMaterialsUuids(SceneObjectPart part, IDictionary<UUID, AssetType> assetUuids) |
218 | { | 222 | { |
219 | // scan thru the dynAttrs map of this part for any textures used as materials | 223 | // scan thru the dynAttrs map of this part for any textures used as materials |
220 | OSDMap OSMaterials = null; | 224 | OSD osdMaterials = null; |
221 | 225 | ||
222 | lock (part.DynAttrs) | 226 | lock (part.DynAttrs) |
223 | { | 227 | { |
224 | if (part.DynAttrs.ContainsKey("OS:Materials")) | 228 | if (part.DynAttrs.ContainsStore("OpenSim", "Materials")) |
225 | OSMaterials = part.DynAttrs["OS:Materials"]; | 229 | { |
226 | if (OSMaterials != null && OSMaterials.ContainsKey("Materials")) | 230 | OSDMap materialsStore = part.DynAttrs.GetStore("OpenSim", "Materials"); |
231 | |||
232 | if (materialsStore == null) | ||
233 | return; | ||
234 | |||
235 | materialsStore.TryGetValue("Materials", out osdMaterials); | ||
236 | } | ||
237 | |||
238 | if (osdMaterials != null) | ||
227 | { | 239 | { |
228 | OSD osd = OSMaterials["Materials"]; | ||
229 | //m_log.Info("[UUID Gatherer]: found Materials: " + OSDParser.SerializeJsonString(osd)); | 240 | //m_log.Info("[UUID Gatherer]: found Materials: " + OSDParser.SerializeJsonString(osd)); |
230 | 241 | ||
231 | if (osd is OSDArray) | 242 | if (osdMaterials is OSDArray) |
232 | { | 243 | { |
233 | OSDArray matsArr = osd as OSDArray; | 244 | OSDArray matsArr = osdMaterials as OSDArray; |
234 | foreach (OSDMap matMap in matsArr) | 245 | foreach (OSDMap matMap in matsArr) |
235 | { | 246 | { |
236 | try | 247 | try |
@@ -268,8 +279,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
268 | } | 279 | } |
269 | } | 280 | } |
270 | } | 281 | } |
271 | 282 | ||
272 | |||
273 | /// <summary> | 283 | /// <summary> |
274 | /// Get an asset synchronously, potentially using an asynchronous callback. If the | 284 | /// Get an asset synchronously, potentially using an asynchronous callback. If the |
275 | /// asynchronous callback is used, we will wait for it to complete. | 285 | /// asynchronous callback is used, we will wait for it to complete. |