Closed EvgeniiKramzyuk closed 7 years ago
Have you tried out my recent PR addressing this?
Not yet in the workplace. This will definitely help remove anchors from the server?
Good point. I'll make sure to add that.
@EvgeniiKramzyuk, I don't think there's currently any way to remove an anchor from the room in the sharing service. That would have to be updated in the main HoloToolkit.
You would need to close the room, and make a new one and join it to reset all the anchors.
Be sure to mark keepAlive = false
so the room doesn't live after all users close the room.
The fact is that I need the same room.
Currently the Sharing Service does not support that.
If you're just trying to get a single anchor you could always get the anchor name and just download the single one. Check out the InportExportAncorManager
for an example of this.
XString roomAnchorId = SharingStage.Instance.CurrentRoom.GetAnchorName("MyAnchor");
if(roomAnchorId != null)
{
roomManager.DownloadAnchor(SharingStage.Instance.CurrentRoom, roomAnchorId.GetString());
}
Thank, I'll try it
@StephenHodgson This method does not help.
XString roomAnchorId = SharingStage.Instance.CurrentRoom.GetAnchorName("MyAnchor"); if(roomAnchorId != null) { roomManager.DownloadAnchor(SharingStage.Instance.CurrentRoom, roomAnchorId.GetString()); }
I believe that this method loads all the anchors from the server, and issues only the one I specified in the parameters.
If there is an one anchor in room, then I event RoomManagerCallbacks_AnchorsDownloaded shows 800.000 bytes (approximately). And if there are 10-12 anchors, then it shows 11.000.000 bytes (approximately).
private void RoomManagerCallbacks_AnchorsDownloaded(bool successful, AnchorDownloadRequest request, XString failureReason)
{
// If we downloaded anchor data successfully we should import the data.
if (successful)
{
int datasize = request.GetDataSize();
Debug.Log(datasize + " bytes ");
rawAnchorData = new byte[datasize];
request.GetData(rawAnchorData, datasize);
CurrentState = ImportExportState.DataReady;
}
else
{
// If we failed, we can ask for the data again.
box.GetComponent<TextMesh>().text += "\n" + "Anchor DL failed " + failureReason;
Debug.Log("Anchor DL failed " + failureReason);
MakeAnchorDataRequest();
}
}
I suggest opening an issue on the main MixedRealityToolkitRepo addressing this enhancement to the sharing service
How could we delete all the anchors inside the room on the server(clear the room) when it's connected to the server (SharingService)? When we try to import the anchor from the room all the anchors are uploaded (WorldAnchorTransferBatch.ImportAsync). It's just wasting of time. I need just one anchor. How can I clear the room of the anchors or send the request to get the particular anchor?