static async Task LoadPMX(StorageFile file, StorageFolder folder, ModelPack pack, ProcessingList processingList) { string path = file.Path; BinaryReader reader = new BinaryReader((await file.OpenReadAsync()).AsStreamForRead()); pack.Reload2(reader); pack.fullPath = path; pack.folder = folder; pack.relativePath = file.Name; reader.Dispose(); processingList.AddObject(pack.GetMesh()); pack.Status = GraphicsObjectStatus.loaded; pack.LoadTask = null; }
public static void ReloadModel(this MMD3DEntity entity, ProcessingList processingList, ModelPack modelPack, List <Texture2D> textures) { entity.ComponentReady = false; var modelResource = modelPack.pmx; entity.morphStateComponent.Reload(modelResource); entity.boneComponent.Reload(modelResource); entity.rendererComponent.Reload(modelPack); processingList.AddObject(new MeshAppendUploadPack(entity.rendererComponent.meshAppend, entity.rendererComponent.meshPosData)); //processingList.AddObject(entity.rendererComponent.meshParticleBuffer); entity.rendererComponent.textures = textures; entity.ComponentReady = true; }