Excellent - that works.  Thanks Justin.  I won't be calling the full update often - just once on login of each AV if they don't already have the relevant attachment, fingers crossed I get no issues.<div><br></div><div>
Neil<br><div><br><div class="gmail_quote">On Wed, Nov 24, 2010 at 11:43 PM, Justin Clark-Casey <span dir="ltr"><<a href="mailto:jjustincc@googlemail.com">jjustincc@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 24/11/10 19:01, Neil Canham wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
   I'm writing a region module for managing appearance / outfits.  One issue I have is that attachments only appear<br>
after a relog.  During the client login I'm using this to attach:<br>
<br>
  m_scenes[0].RezSingleAttachment(client, item.ID, (uint)AttachmentPoint.HUDTop);<br>
<br>
in 0.6.9 - and I find I have to log out and then back in to see the attachment, I assume because the client didn't<br>
request the attachment it isn't looking out for it?  Is there any way that I can force the attachment to happen (I tried<br>
a ScenePresence SendWearables() but that seemed to not know about the attachment)<br>
</blockquote>
<br></div></div>
In 0.7 (I think) and later, it's possible to attach (and move) hud objects with code like<br>
<br>
<paste><br>
IAttachmentsModule module = client.Scene.RequestModuleInterface<IAttachmentsModule>();<br>
UUID sceneObjectId<br>
    = module.RezSingleAttachmentFromInventory(client, itemId, (uint)AttachmentPoint.HUDTop);<br>
SceneObjectGroup sog = scene.GetSceneObjectPart(sceneObjectId).ParentGroup;<br>
<br>
// Move HUD<br>
<br>
// A temporary messy solution to an occasional race where the attached hud sometimes ends up positioned<br>
// on the avatar itself and does not show up as attached within inventory.<br>
Thread.Sleep(1000);<br>
<br>
Vector3 newPos = new Vector3(0, 0, -0.1f);<br>
m_log.DebugFormat("[EXAMPLE]: Resetting HUD position to {0}", newPos);<br>
module.UpdateAttachmentPosition(client, sog, newPos);<br>
</paste><br>
<br>
However, the attachment code has changed a lot since 0.6.9 (for starters, it had no separate AttachmentsModule).  You might want to try something like<br>
<br>
sog.HasGroupChanged = true;<br>
sog.ScheduleGroupForFullUpdate();<br>
<br>
to make sure the server sends an object notification to the viewer.  However, don't overuse this, since unnecessary multiple updates can sometimes lead to race conditions and viewer update glitches.<br><font color="#888888">
<br>
-- <br>
Justin Clark-Casey (justincc)<br>
<a href="http://justincc.org" target="_blank">http://justincc.org</a><br>
<a href="http://twitter.com/justincc" target="_blank">http://twitter.com/justincc</a><br>
_______________________________________________<br>
Opensim-dev mailing list<br>
<a href="mailto:Opensim-dev@lists.berlios.de" target="_blank">Opensim-dev@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-dev" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><br>
</font></blockquote></div><br></div></div>