Skip to content

Commit ef932cd

Browse files
committed
Addressed PR comments.
1 parent 9c739b3 commit ef932cd

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ option(MATERIALX_BUILD_DOCS "Create HTML documentation using Doxygen. Requires t
4040

4141
option(MATERIALX_BUILD_GEN_GLSL "Build the GLSL shader generator back-end." ON)
4242
option(MATERIALX_BUILD_GEN_OSL "Build the OSL shader generator back-end." ON)
43-
option(MATERIALX_BUILD_GEN_OSL_NODES "Build the OSL nodes shader generator back-end." ON)
43+
option(MATERIALX_BUILD_GEN_OSL_NODES "Build the OSL nodes shader generator back-end." OFF)
4444
option(MATERIALX_BUILD_GEN_MDL "Build the MDL shader generator back-end." ON)
4545
option(MATERIALX_BUILD_GEN_MSL "Build the MSL shader generator back-end." ON)
4646
option(MATERIALX_BUILD_RENDER "Build the MaterialX Render modules." ON)
@@ -138,6 +138,12 @@ if(SKBUILD)
138138
set(MATERIALX_PYTHON_FOLDER_NAME "MaterialX")
139139
endif()
140140

141+
if (MATERIALX_BUILD_GEN_OSL_NODES)
142+
set(MATERIALX_BUILD_GEN_OSL ON)
143+
set(MATERIALX_BUILD_RENDER ON)
144+
set(MATERIALX_BUILD_RENDER_PLATFORMS ON)
145+
endif()
146+
141147
# Helpers for MDL validation
142148
if (MATERIALX_BUILD_GEN_MDL)
143149
set(MATERIALX_MDLC_EXECUTABLE "" CACHE FILEPATH "Full path to the mdlc binary.")

source/MaterialXGenOslNodes/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
file(GLOB GenNodes_SRC "${CMAKE_CURRENT_SOURCE_DIR}/LibsToOso.cpp")
42

53
set(MATERIALX_LIBRARIES
@@ -19,7 +17,8 @@ set_target_properties(
1917
MaterialXGenOslNodes_LibsToOso PROPERTIES
2018
INSTALL_RPATH "${MATERIALX_UP_ONE_RPATH}")
2119

22-
# TODO: We likely want to install that file elsewhere and not under `bin`...
20+
# TODO: We likely want to install that file elsewhere and not under `bin`,
21+
# if at all, as we maybe want to keep this executable available at build time only.
2322
install(TARGETS MaterialXGenOslNodes_LibsToOso
2423
EXPORT MaterialX
2524
RUNTIME DESTINATION ${MATERIALX_INSTALL_BIN_PATH})

source/MaterialXGenOslNodes/LibsToOso.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ int main(int argc, char* const argv[])
210210

211211
// Setup the context of the OSL shader generator.
212212
mx::GenContext context(oslShaderGen);
213-
context.getOptions().addUpstreamDependencies = false;
214213
context.registerSourceCodeSearchPath(librariesSearchPath);
214+
// TODO: It might be good to find a way to not hardcode these options, especially the texture flip.
215+
context.getOptions().addUpstreamDependencies = false;
215216
context.getOptions().fileTextureVerticalFlip = true;
216217

217218
// TODO: Add control over the name of the log file?
@@ -249,7 +250,7 @@ int main(int argc, char* const argv[])
249250
{
250251
logFile << "The following `NodeDef` does not provide a valid OSL implementation, "
251252
"and will be skipped: "
252-
<< nodeName << std::endl;
253+
<< nodeDef->getName() << std::endl;
253254

254255
continue;
255256
}

0 commit comments

Comments
 (0)