//---------------------------------------------------------------------------------------------------------------------- #region Button callbacks void OnAddDCCToolButtonClicked() { string folder = EditorUtility.OpenFolderPanel("Add DCC Tool", m_lastOpenedFolder, ""); if (string.IsNullOrEmpty(folder)) { return; } m_lastOpenedFolder = folder; //Find the path to the actual app DCCToolType lastDCCToolType = DCCToolType.AUTODESK_MAYA; DCCToolInfo dccToolInfo = null; for (int i = 0; i < (int)(DCCToolType.NUM_DCC_TOOL_TYPES) && null == dccToolInfo; ++i) { lastDCCToolType = (DCCToolType)(i); dccToolInfo = DCCFinderUtility.FindDCCToolInDirectory(lastDCCToolType, null, m_lastOpenedFolder); } if (null == dccToolInfo) { EditorUtility.DisplayDialog("MeshSync Project Settings", "No DCC Tool is detected", "Ok"); return; } //Add MeshSyncEditorSettings settings = MeshSyncEditorSettings.GetOrCreateSettings(); if (settings.AddDCCTool(dccToolInfo)) { Setup(m_root); } }
//---------------------------------------------------------------------------------------------------------------------- //return true if there is any change internal bool AddInstalledDCCTools() { bool ret = false; Dictionary<string, DCCToolInfo> dccPaths = DCCFinderUtility.FindInstalledDCCTools(); foreach (var dcc in dccPaths) { DCCToolInfo info = dcc.Value; bool added = AddDCCTool(info, false); ret = ret || added; } SaveEditorSettings(); return ret; }