///<summary> /// When called, fills all the lists and does a ManualUnFocus to deactivate all useless mesh renderers. ///</summary> ///<param name="e">The event's instance</param> private void OnImportFinished(ImportFinishedEvent e) { if (isDeleted) { return; } InitHandler(); if (GameManager.gm.currentItems.Contains(gameObject)) { UpdateChildMeshRenderers(true, true); transform.GetChild(0).GetComponent <Renderer>().enabled = true; return; } OObject selectionReferent = GameManager.gm.currentItems.Count > 0 ? GameManager.gm.currentItems[0].GetComponent <OObject>()?.referent : null; if (GetComponent <OObject>().category != "device" && selectionReferent != GetComponent <OObject>().referent) { UpdateChildMeshRenderersRec(false); } else if (selectionReferent == GetComponent <OObject>().referent) { if (!GameManager.gm.currentItems.Contains(gameObject) && !GameManager.gm.currentItems.Contains(transform.parent.gameObject)) { ToggleCollider(gameObject, false); UpdateOwnMeshRenderers(false); UpdateChildMeshRenderers(false); } if (GameManager.gm.currentItems.Contains(transform.parent.gameObject)) { print("##" + name); UpdateChildMeshRenderers(false); } } }
static void ImportVideo(string videoFile) { AutoResetEvent AbortEvent = new AutoResetEvent(false); ImportStartedEvent?.Invoke( videoFile, () => AbortEvent.Set()); try { uint NumFrames; PrepVideo.SplitFrames( FFMPEG_BIN, videoFile, SplitProgress, AbortEvent, out NumFrames); MeshroomCompute.PhotogrammImages( MESHROOM_COMPUTE_BIN, SENSOR_DATABASE, VOC_TREE, PrepVideo.GetImagesDir(videoFile), TIME_BASE, NumFrames, MeshroomProgress, AbortEvent); /* * create positions file last, we use it to * figure out if a video have been imported */ PrepVideo.ExtractSubtitles(FFMPEG_BIN, videoFile, AbortEvent); ImportFinishedEvent?.Invoke(); VideoOpenedEvent?.Invoke(videoFile); } catch (ProcessAborted) { ImportCanceledEvent?.Invoke(); } }