Skip to content

Conversation

@ppenenko
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds Visual Studio Code development environment configurations and CMake presets to the MaterialX repository. The changes aim to streamline the development workflow for contributors using VS Code on Windows.

Changes:

  • Added CMakePresets.json with Windows-specific Visual Studio 2022 build configurations
  • Added VS Code tasks for configuring, building, and installing MaterialX
  • Added VS Code settings for C++ file associations, Python configuration, and pytest integration
  • Added VS Code launch configuration for debugging MaterialXView

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
CMakePresets.json Defines CMake configuration and build presets for Visual Studio 2022 with Debug/Release configurations and optional Metashade support
.vscode/tasks.json Provides VS Code tasks for CMake configuration, build, install, and clean operations
.vscode/settings.json Contains C++ file associations, Python interpreter settings, and pytest configuration
.vscode/launch.json Defines debug launch configuration for MaterialXView using Windows debugger

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +64
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/installed",
"MATERIALX_BUILD_VIEWER": "ON",
"MATERIALX_BUILD_GRAPH_EDITOR": "ON",
"MATERIALX_BUILD_PYTHON": "ON",
"MATERIALX_BUILD_TESTS": "ON",
"MATERIALX_BUILD_METASHADE": "OFF"
}
},
{
"name": "default",
"inherits": "windows-base",
"displayName": "Default (Windows)",
"description": "Default build options for Windows (No Metashade)"
},
{
"name": "metashade",
"inherits": "windows-base",
"displayName": "Metashade (Windows)",
"description": "Build with Metashade features enabled",
"cacheVariables": {
"MATERIALX_BUILD_METASHADE": "ON"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "default",
"configuration": "Debug",
"displayName": "Debug Build",
"description": "Debug build (Default)"
},
{
"name": "debug-metashade",
"configurePreset": "metashade",
"configuration": "Debug",
"displayName": "Debug Build (Metashade)",
"description": "Debug build with Metashade"
},
{
"name": "release",
"configurePreset": "default",
"configuration": "Release",
"displayName": "Release Build",
"description": "Release build"
},
{
"name": "release-metashade",
"configurePreset": "metashade",
"configuration": "Release",
"displayName": "Release Build (Metashade)",
"description": "Release build with Metashade"
}
]
} No newline at end of file
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CMake presets file is Windows-specific (using "Visual Studio 17 2022" generator) but is placed at the repository root where it will apply to all users on all platforms. MaterialX is a cross-platform project that supports Windows, macOS, and Linux. Consider one of the following approaches:

  1. Add presets for macOS (Xcode, Unix Makefiles) and Linux (Unix Makefiles, Ninja) platforms
  2. Rename or organize the file to indicate it's Windows-specific (e.g., CMakePresets-Windows.json and provide platform-specific alternatives)
  3. Use CMakeUserPresets.json instead, which is typically git-ignored and allows per-user configuration without forcing platform-specific settings on all contributors

Copilot uses AI. Check for mistakes.
Comment on lines 3 to 42
"files.associations": {
"xlocale": "cpp",
"xlocmon": "cpp",
"chrono": "cpp",
"functional": "cpp",
"future": "cpp",
"memory": "cpp",
"random": "cpp",
"ratio": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"variant": "cpp",
"xmemory0": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"array": "cpp",
"compare": "cpp",
"format": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xtree": "cpp",
"algorithm": "cpp",
"xiosbase": "cpp"
},
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.defaultInterpreterPath": "C:\\Users\\tripc\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Python interpreter path is user-specific and hardcoded to a Windows path for user "tripc". VS Code settings files that are checked into the repository should not contain user-specific paths, as they will not work for other contributors. Consider:

  1. Removing this line entirely - VS Code will use the system Python or user's configured default
  2. Moving this configuration to .vscode/settings.json.user or a similar git-ignored file
  3. Using a relative path or environment variable if a specific Python version is required

The same issue applies to the file associations (lines 3-34) which appear to be auto-generated by VS Code based on individual development activity and may not be universally applicable.

Suggested change
"files.associations": {
"xlocale": "cpp",
"xlocmon": "cpp",
"chrono": "cpp",
"functional": "cpp",
"future": "cpp",
"memory": "cpp",
"random": "cpp",
"ratio": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"variant": "cpp",
"xmemory0": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"array": "cpp",
"compare": "cpp",
"format": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xtree": "cpp",
"algorithm": "cpp",
"xiosbase": "cpp"
},
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.defaultInterpreterPath": "C:\\Users\\tripc\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 47
{
"cmake.sourceDirectory": "${workspaceFolder}",
"files.associations": {
"xlocale": "cpp",
"xlocmon": "cpp",
"chrono": "cpp",
"functional": "cpp",
"future": "cpp",
"memory": "cpp",
"random": "cpp",
"ratio": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"variant": "cpp",
"xmemory0": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"array": "cpp",
"compare": "cpp",
"format": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xtree": "cpp",
"algorithm": "cpp",
"xiosbase": "cpp"
},
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.defaultInterpreterPath": "C:\\Users\\tripc\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
"python.analysis.extraPaths": [
"${workspaceFolder}/build/python",
"${workspaceFolder}/python"
]
} No newline at end of file
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file associations listed here (lines 3-34) appear to be auto-generated by VS Code based on individual usage patterns. These associations are typically user-specific and don't need to be shared across the team. Unless there's a specific reason to include them (e.g., enforcing specific IntelliSense behavior for the project), consider removing them to keep the settings file focused on project-wide requirements.

Suggested change
{
"cmake.sourceDirectory": "${workspaceFolder}",
"files.associations": {
"xlocale": "cpp",
"xlocmon": "cpp",
"chrono": "cpp",
"functional": "cpp",
"future": "cpp",
"memory": "cpp",
"random": "cpp",
"ratio": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"variant": "cpp",
"xmemory0": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"array": "cpp",
"compare": "cpp",
"format": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xtree": "cpp",
"algorithm": "cpp",
"xiosbase": "cpp"
},
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.defaultInterpreterPath": "C:\\Users\\tripc\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
"python.analysis.extraPaths": [
"${workspaceFolder}/build/python",
"${workspaceFolder}/python"
]
}
{
"cmake.sourceDirectory": "${workspaceFolder}",
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.defaultInterpreterPath": "C:\\Users\\tripc\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
"python.analysis.extraPaths": [
"${workspaceFolder}/build/python",
"${workspaceFolder}/python"
]
}

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +14
{
"name": "Launch MaterialXView",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/Debug/MaterialXView.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/resources/Materials/Examples/StandardSurface",
"environment": [],
"console": "integratedTerminal"
}
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This launch configuration uses a Windows-specific debugger type ("cppvsdbg") and hardcoded Windows paths (.exe extension, Windows-style path separators). Since MaterialX is a cross-platform project supporting Windows, macOS, and Linux, consider:

  1. Adding platform-specific launch configurations for macOS (using "lldb") and Linux (using "gdb")
  2. Documenting that this configuration is Windows-only in the name or description
  3. Using VS Code variables and conditional configurations where possible to support multiple platforms

The hardcoded path to MaterialXView.exe will only work on Windows systems with Visual Studio builds.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +133
{
"version": "2.0.0",
"tasks": [
{
"label": "Configure MaterialX",
"type": "shell",
"command": "cmake",
"args": [
"--preset",
"default"
],
"group": "build",
"problemMatcher": [],
"isBackground": false,
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Configure MaterialX (Metashade)",
"type": "shell",
"command": "cmake",
"args": [
"--preset",
"metashade"
],
"group": "build",
"problemMatcher": [],
"isBackground": false,
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Build MaterialX Debug",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"--preset",
"debug"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$msCompile",
"$gcc"
],
"isBackground": false,
"dependsOn": "Configure MaterialX",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Build MaterialX Debug (Metashade)",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"--preset",
"debug-metashade"
],
"group": "build",
"problemMatcher": [
"$msCompile",
"$gcc"
],
"isBackground": false,
"dependsOn": "Configure MaterialX (Metashade)",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Install MaterialX Debug",
"type": "shell",
"command": "cmake",
"args": [
"--install",
"build",
"--config",
"Debug"
],
"group": "build",
"problemMatcher": [],
"isBackground": false,
"dependsOn": "Build MaterialX Debug",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Build MaterialX Release (Metashade)",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"--preset",
"release-metashade"
],
"group": "build",
"problemMatcher": [
"$msCompile",
"$gcc"
],
"isBackground": false,
"dependsOn": "Configure MaterialX (Metashade)",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Clean MaterialX",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"build",
"--target",
"clean"
],
"group": "build",
"problemMatcher": [],
"isBackground": false,
"options": {
"cwd": "${workspaceFolder}"
}
}
]
} No newline at end of file
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VS Code tasks defined here use CMake presets that are only defined for Windows in CMakePresets.json. Since this tasks file will be used by all contributors regardless of platform, the tasks will fail on macOS and Linux systems. The tasks should either:

  1. Be platform-conditional (using VS Code's platform-specific task syntax)
  2. Reference CMake presets that exist for all platforms
  3. Be moved to user-specific configuration files

Additionally, tasks like "Install MaterialX Debug" assume a Windows-style Debug configuration, which may not apply to Unix Makefiles generators used on other platforms.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +114
{
"label": "Build MaterialX Release (Metashade)",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"--preset",
"release-metashade"
],
"group": "build",
"problemMatcher": [
"$msCompile",
"$gcc"
],
"isBackground": false,
"dependsOn": "Configure MaterialX (Metashade)",
"options": {
"cwd": "${workspaceFolder}"
}
},
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tasks are missing a "Build MaterialX Release" task (without Metashade). Currently, there are build tasks for:

  • Build MaterialX Debug (line 35)
  • Build MaterialX Debug (Metashade) (line 58)
  • Build MaterialX Release (Metashade) (line 96)

But no corresponding "Build MaterialX Release" task that uses the "release" build preset defined in CMakePresets.json (line 50-55). This creates an inconsistency where users can build Debug with and without Metashade, but can only build Release with Metashade enabled.

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 47
{
"cmake.sourceDirectory": "${workspaceFolder}",
"files.associations": {
"xlocale": "cpp",
"xlocmon": "cpp",
"chrono": "cpp",
"functional": "cpp",
"future": "cpp",
"memory": "cpp",
"random": "cpp",
"ratio": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"variant": "cpp",
"xmemory0": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"array": "cpp",
"compare": "cpp",
"format": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xtree": "cpp",
"algorithm": "cpp",
"xiosbase": "cpp"
},
"python.testing.pytestArgs": [
"python/MaterialXTest"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.defaultInterpreterPath": "C:\\Users\\tripc\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
"python.analysis.extraPaths": [
"${workspaceFolder}/build/python",
"${workspaceFolder}/python"
]
} No newline at end of file
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .vscode directory is being added to version control, but it contains user-specific settings (such as the hardcoded Python interpreter path and auto-generated file associations). Common practice for IDE/editor configurations is to either:

  1. Add .vscode/ to .gitignore and provide example configurations in documentation
  2. Only commit workspace-level settings that are truly project-wide, while excluding user-specific settings
  3. Provide .vscode/*.example files that users can copy and customize

Since MaterialX is a cross-platform project with contributors using different operating systems and development environments, committing Windows-specific VS Code configurations may not be appropriate for the main repository.

Copilot uses AI. Check for mistakes.
@ppenenko ppenenko merged commit 6203d72 into metashade:metashade/dev Jan 25, 2026
16 of 17 checks passed
@ppenenko ppenenko deleted the vscode-cmake-setup branch January 25, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant