public void LoadSkyboxModelsFromFixedModelList(string rootFolder) { string[] fileNames = new[] { "vr_sky", "vr_kasumi_mae", "vr_uso_umi", "vr_back_cloud" }; string[] extNames = new[] { ".bmd", ".bdl" }; foreach (var model in fileNames) { foreach (var ext in extNames) { string fullPath = Path.Combine(rootFolder, model + ext); if (File.Exists(fullPath)) { J3D j3dModel = WResourceManager.LoadResource(fullPath); J3DNode modelNode = new J3DNode(j3dModel, m_world, fullPath); switch (model) { case "vr_sky": m_vrSky = modelNode; break; case "vr_kasumi_mae": m_vrKasumiMae = modelNode; break; case "vr_uso_umi": m_vrUsoUmi = modelNode; break; case "vr_back_cloud": m_vrBackCloud = modelNode; break; } } } } }
protected virtual J3D LoadModel(string rootFolder, string modelName) { string[] extNames = new[] { ".bmd", ".bdl" }; foreach (var ext in extNames) { string fullPath = Path.Combine(rootFolder, modelName + ext); if (File.Exists(fullPath)) { J3D j3dMesh = WResourceManager.LoadResource(fullPath); // Now that we've loaded a j3dMesh, we're going to try loading btk anims too. string btkFolder = rootFolder + "\\..\\btk\\"; string btkFile = btkFolder + modelName + ".btk"; if (File.Exists(btkFile)) { j3dMesh.LoadMaterialAnim(btkFile); j3dMesh.SetMaterialAnimation(modelName); } return(j3dMesh); } } return(null); }
private void ImportVisualMeshToCategory(View.VisualMeshImportWindow importWindow, CategoryDOMNode category, string meshName) { List <J3DNode> meshList = category.GetChildrenOfType <J3DNode>(); bool isBDL = true; J3DNode oldMeshNode = meshList.Find(x => x.Name == meshName); if (oldMeshNode != null) { category.Children.Remove(oldMeshNode); isBDL = oldMeshNode.Model.StudioType == "bdl4"; } string fileExt = Path.GetExtension(importWindow.FileName); string loadFilename = ""; if (fileExt == ".bmd" || fileExt == ".bdl") { loadFilename = importWindow.FileName; } else { loadFilename = ImportVisualMesh(importWindow, isBDL); } JStudio.J3D.J3D newMesh = WResourceManager.LoadResource(loadFilename); newMesh.Name = meshName; J3DNode newNode = new J3DNode(newMesh, MainWorld, loadFilename); category.Children.Add(newNode); }