Skip to content

Commit

Permalink
Remove arnold to usd converter (#1398)
Browse files Browse the repository at this point in the history
* remove usd writer

* update deprecated functions in the testsuite

* disable ADP when running the testsuite

* fix deprecation warning
  • Loading branch information
cpichard authored Jan 23, 2023
1 parent 4571d43 commit 13ac513
Show file tree
Hide file tree
Showing 28 changed files with 59 additions and 99 deletions.
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,11 @@ if (NOT USD_STATIC_BUILD)
endif ()
endif ()

if (BUILD_PROCEDURAL OR BUILD_USD_WRITER)
add_subdirectory(translator)
endif ()

if (BUILD_PROCEDURAL)
add_subdirectory(translator)
add_subdirectory(procedural)
endif ()

if (BUILD_USD_WRITER)
add_subdirectory(cmd)
endif ()

if (BUILD_DOCS)
add_subdirectory(docs)
endif ()
Expand Down
28 changes: 2 additions & 26 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ vars.AddVariables(
BoolVariable('BUILD_RENDER_DELEGATE', 'Whether or not to build the hydra render delegate.', True),
BoolVariable('BUILD_NDR_PLUGIN', 'Whether or not to build the node registry plugin.', True),
BoolVariable('BUILD_USD_IMAGING_PLUGIN', 'Whether or not to build the usdImaging plugin.', True),
BoolVariable('BUILD_USD_WRITER', 'Whether or not to build the arnold to usd writer tool.', True),
BoolVariable('BUILD_PROCEDURAL', 'Whether or not to build the arnold procedural.', True),
BoolVariable('BUILD_SCENE_DELEGATE', 'Whether or not to build the arnold scene delegate.', False),
BoolVariable('BUILD_TESTSUITE', 'Whether or not to build the testsuite.', True),
Expand Down Expand Up @@ -157,7 +156,6 @@ BUILD_RENDER_DELEGATE = env['BUILD_RENDER_DELEGATE'] if USD_BUILD_MODE != 'st
BUILD_NDR_PLUGIN = env['BUILD_NDR_PLUGIN'] if USD_BUILD_MODE != 'static' else False
BUILD_USD_IMAGING_PLUGIN = env['BUILD_USD_IMAGING_PLUGIN'] if BUILD_SCHEMAS else False
BUILD_SCENE_DELEGATE = env['BUILD_SCENE_DELEGATE'] if USD_BUILD_MODE != 'static' else False
BUILD_USD_WRITER = env['BUILD_USD_WRITER']
BUILD_PROCEDURAL = env['BUILD_PROCEDURAL']
BUILD_TESTSUITE = env['BUILD_TESTSUITE']
BUILD_DOCS = env['BUILD_DOCS']
Expand Down Expand Up @@ -423,9 +421,6 @@ else:
procedural_script = os.path.join('procedural', 'SConscript')
procedural_build = os.path.join(BUILD_BASE_DIR, 'procedural')

cmd_script = os.path.join('cmd', 'SConscript')
cmd_build = os.path.join(BUILD_BASE_DIR, 'cmd')

schemas_script = os.path.join('schemas', 'SConscript')
schemas_build = os.path.join(BUILD_BASE_DIR, 'schemas')

Expand Down Expand Up @@ -469,7 +464,7 @@ else:
# Define targets
# Target for the USD procedural

if BUILD_PROCEDURAL or BUILD_USD_WRITER:
if BUILD_PROCEDURAL:
TRANSLATOR = env.SConscript(translator_script,
variant_dir = translator_build,
duplicate = 0, exports = 'env')
Expand Down Expand Up @@ -513,19 +508,6 @@ if BUILD_SCHEMAS:
else:
SCHEMAS = None

if BUILD_USD_WRITER:
ARNOLD_TO_USD = env.SConscript(cmd_script, variant_dir = cmd_build, duplicate = 0, exports = 'env')
SConscriptChdir(0)
Depends(ARNOLD_TO_USD, TRANSLATOR[0])
if env['USD_BUILD_MODE'] == 'static':
# For static builds of the writer, we need to copy the usd
# resources to the same path as the procedural
usd_target_resource_folder = os.path.join(os.path.dirname(os.path.abspath(str(ARNOLD_TO_USD[0]))), 'usd')
if os.path.exists(usd_input_resource_folder) and not os.path.exists(usd_target_resource_folder):
shutil.copytree(usd_input_resource_folder, usd_target_resource_folder)
else:
ARNOLD_TO_USD = None

if BUILD_RENDER_DELEGATE:
RENDERDELEGATE = env.SConscript(renderdelegate_script, variant_dir = renderdelegate_build, duplicate = 0, exports = 'env')
SConscriptChdir(0)
Expand Down Expand Up @@ -611,7 +593,7 @@ if BUILD_TESTSUITE:
else:
TESTSUITE = None

for target in [RENDERDELEGATE, PROCEDURAL, SCHEMAS, ARNOLD_TO_USD, RENDERDELEGATE, DOCS, TESTSUITE, NDRPLUGIN, USDIMAGINGPLUGIN, HYDRA_TEST]:
for target in [RENDERDELEGATE, PROCEDURAL, SCHEMAS, RENDERDELEGATE, DOCS, TESTSUITE, NDRPLUGIN, USDIMAGINGPLUGIN, HYDRA_TEST]:
if target:
env.AlwaysBuild(target)

Expand All @@ -626,12 +608,6 @@ if PROCEDURAL:
INSTALL_PROC += env.Install(PREFIX_PROCEDURAL, usd_input_resource_folder)
env.Alias('procedural-install', INSTALL_PROC)

if ARNOLD_TO_USD:
INSTALL_ARNOLD_TO_USD = env.Install(PREFIX_BIN, ARNOLD_TO_USD)
if env['USD_BUILD_MODE'] == 'static':
INSTALL_ARNOLD_TO_USD += env.Install(PREFIX_BIN, usd_input_resource_folder)
env.Alias('writer-install', INSTALL_ARNOLD_TO_USD)

if RENDERDELEGATE:
if IS_WINDOWS:
INSTALL_RENDERDELEGATE = env.Install(PREFIX_RENDER_DELEGATE, RENDERDELEGATE)
Expand Down
1 change: 0 additions & 1 deletion cmake/utils/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ option(BUILD_RENDER_DELEGATE "Builds the Render Delegate" ON)
option(BUILD_NDR_PLUGIN "Builds the NDR Plugin" ON)
option(BUILD_PROCEDURAL "Builds the Procedural" ON)
option(BUILD_PROC_SCENE_FORMAT "Enables the Procedural Scene format" ON)
option(BUILD_USD_WRITER "Builds the USD Writer" ON)
option(BUILD_USD_IMAGING_PLUGIN "Builds the USD Imaging plugins" ON)
option(BUILD_SCENE_DELEGATE "Builds the Scene Delegate" OFF)
option(BUILD_DOCS "Builds the Documentation" OFF)
Expand Down
2 changes: 1 addition & 1 deletion cmake/utils/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ endfunction()
function(add_translator_unit_test)
# We are ignoring the tests so the scripts that automatically scan the folders will skip these folders.
ignore_test(${ARGN})
if (NOT BUILD_PROCEDURAL AND NOT BUILD_USD_WRITER)
if (NOT BUILD_PROCEDURAL)
return()
endif ()
foreach (_test_name ${ARGN})
Expand Down
5 changes: 0 additions & 5 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Sample `custom.py` files are provided in the _Examples_ section below.
- `BUILD_SCHEMAS`: Whether or not to build the schemas and their wrapper.
- `BUILD_RENDER_DELEGATE`: Whether or not to build the hydra render delegate.
- `BUILD_NDR_PLUGIN`: Whether or not to build the node registry plugin.
- `BUILD_USD_WRITER`: Whether or not to build the arnold to usd writer tool.
- `BUILD_PROCEDURAL`: Whether or not to build the arnold procedural.
- `BUILD_TESTSUITE`: Whether or not to build the testsuite.
- `BUILD_DOCS`: Whether or not to build the documentation.
Expand Down Expand Up @@ -136,7 +135,6 @@ PYTHON_LIB_NAME='python2.7'

BUILD_SCHEMAS=False
BUILD_RENDER_DELEGATE=True
BUILD_USD_WRITER=True
BUILD_PROCEDURAL=True
BUILD_TESTSUITE=True
BUILD_DOCS=True
Expand Down Expand Up @@ -171,7 +169,6 @@ BUILD_SCHEMAS=False
BUILD_RENDER_DELEGATE=True
BUILD_PROCEDURAL=True
BUILD_TESTSUITE=True
BUILD_USD_WRITER=True
BUILD_DOCS=False

PREFIX=r'C:\solidAngle\arnold-usd'
Expand Down Expand Up @@ -211,7 +208,6 @@ BUILD_RENDER_DELEGATE=True
BUILD_NDR_PLUGIN=True
BUILD_PROCEDURAL=True
BUILD_TESTSUITE=True
BUILD_USD_WRITER=True
BUILD_DOCS=True
~~~

Expand All @@ -223,7 +219,6 @@ We also support building the project with cmake to allow for greater flexibility
- `BUILD_SCHEMAS`: Whether or not to build the schemas and their wrapper.
- `BUILD_RENDER_DELEGATE`: Whether or not to build the hydra render delegate.
- `BUILD_NDR_PLUGIN`: Whether or not to build the node registry plugin.
- `BUILD_USD_WRITER`: Whether or not to build the arnold to usd writer tool.
- `BUILD_PROCEDURAL`: Whether or not to build the arnold procedural.
- `BUILD_TESTSUITE`: Whether or not to build the testsuite.
- `BUILD_UNIT_TESTS`: Whether or not to build the unit tests.
Expand Down
7 changes: 5 additions & 2 deletions testsuite/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def run_test(target, source, env):
local_env['ADCLMHUB_LOG_DIR'] = test_dir
local_env['ADCLMHUB_LOG_LEVEL'] = 'T'

# Disable ADP for the tests
local_env['ARNOLD_ADP_DISABLE'] = '1'

output_image = test_env['OUTPUT_IMAGE']
if output_image:
output_image = os.path.join(test_dir, output_image)
Expand Down Expand Up @@ -621,7 +624,7 @@ TRANSLATOR_BUILD_PATH = os.path.join(build_base_dir, 'translator')
RENDER_DELEGATE_BUILD_PATH = os.path.join(build_base_dir, 'render_delegate')
NDR_PLUGIN_BUILD_PATH = os.path.join(build_base_dir, 'ndr')
if env['ENABLE_UNIT_TESTS']:
if env['BUILD_PROCEDURAL'] or env['BUILD_USD_WRITER']:
if env['BUILD_PROCEDURAL']:
test_env.Append(CPPPATH = TRANSLATOR_BUILD_PATH)
test_env.Append(LIBPATH = TRANSLATOR_BUILD_PATH)
if env['BUILD_RENDER_DELEGATE']:
Expand Down Expand Up @@ -803,7 +806,7 @@ for target in sorted(TEST_NAMES, reverse=(env['TEST_ORDER']=='reverse')):
cloned_env.Append(RPATH = NDR_PLUGIN_BUILD_PATH)
test_target = Test.CreateTest(target, locals(), program_sources = source_deps).prepare_test(target, cloned_env)
elif target in UNIT_TESTS['translator']:
if (not env['BUILD_PROCEDURAL'] and not env['BUILD_USD_WRITER']) or not env['ENABLE_UNIT_TESTS']:
if (not env['BUILD_PROCEDURAL']) or not env['ENABLE_UNIT_TESTS']:
continue
cloned_env = test_env.Clone()
source_deps, lib_deps = sa.dependencies.translator(cloned_env, [])
Expand Down
8 changes: 4 additions & 4 deletions testsuite/test_0038/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

int main(int argc, char **argv)
{
AiMsgSetConsoleFlags(AI_LOG_ALL);
AiMsgSetConsoleFlags(nullptr, AI_LOG_ALL);
AiBegin();

AtUniverse *proc_universe = AiUniverse();

AiASSLoad("scene.ass");
AiSceneLoad(nullptr, "scene.ass", nullptr);
// load the usd procedural (containing a sphere) in a separate universe
AiASSLoad(proc_universe, "usd_proc.ass");
AiSceneLoad(proc_universe, "usd_proc.ass", nullptr);
AtNode *proc_a = AiNode(proc_universe, "usd", "usd_proc_a");
AiNodeSetStr(proc_a, "filename", "usd_proc_a.usda");
// Call the viewport API on the usd procedural, and fill the main universe
Expand All @@ -24,7 +24,7 @@ int main(int argc, char **argv)
AiProceduralViewport(proc_b, nullptr, AI_PROC_BOXES);

AiUniverseDestroy(proc_universe);
AiRender();
AiRender(nullptr);

AiEnd();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0134/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0136/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
16 changes: 8 additions & 8 deletions testsuite/test_0138/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

int main(int argc, char **argv)
{
AiMsgSetConsoleFlags(AI_LOG_ALL);
AiMsgSetConsoleFlags(nullptr, AI_LOG_ALL);
AiBegin();
AiASSLoad("scene.ass");
AiSceneLoad(nullptr, "scene.ass", nullptr);
AtParamValueMap* params = AiParamValueMap();
AiParamValueMapSetStr(params, AtString("scope"), AtString("beautiful/scope"));
AiSceneWrite(nullptr, "scene.usda", params);
Expand All @@ -19,27 +19,27 @@ int main(int argc, char **argv)
bool success = true;
AiSceneLoad(nullptr, "scene.usda", nullptr);

if (!AiNodeLookUpByName("/beautiful/scope/my/sphere/name")) {
if (!AiNodeLookUpByName(nullptr, "/beautiful/scope/my/sphere/name")) {
AiMsgError("/beautiful/scope/my/sphere/name doesn't exist");
success = false;
}
if (!AiNodeLookUpByName("/beautiful/scope/my/cube/name")) {
if (!AiNodeLookUpByName(nullptr, "/beautiful/scope/my/cube/name")) {
AiMsgError("/beautiful/scope/my/cone/name doesn't exist");
success = false;
}
if (!AiNodeLookUpByName("/beautiful/scope/lambert1/lambert1")) {
if (!AiNodeLookUpByName(nullptr, "/beautiful/scope/lambert1/lambert1")) {
AiMsgError("/beautiful/scope/lambert1 doesn't exist");
success = false;
}
if (!AiNodeLookUpByName("/beautiful/scope/persp/perspShape")) {
if (!AiNodeLookUpByName(nullptr, "/beautiful/scope/persp/perspShape")) {
AiMsgError("/beautiful/scope/persp/perspShape doesn't exist");
success = false;
}
if (!AiNodeLookUpByName("/beautiful/scope/defaultArnoldFilter_gaussian_filter")) {
if (!AiNodeLookUpByName(nullptr, "/beautiful/scope/defaultArnoldFilter_gaussian_filter")) {
AiMsgError("/beautiful/scope/defaultArnoldFilter_gaussian_filter doesn't exist");
success = false;
}
if (!AiNodeLookUpByName("/beautiful/scope/directionalLight1/directionalLightShape1")) {
if (!AiNodeLookUpByName(nullptr, "/beautiful/scope/directionalLight1/directionalLightShape1")) {
AiMsgError("/beautiful/scope/directionalLight1/directionalLightShape1 doesn't exist");
success = false;
}
Expand Down
6 changes: 3 additions & 3 deletions testsuite/test_0142/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

int main(int argc, char **argv)
{
AiMsgSetConsoleFlags(AI_LOG_ALL);
AiMsgSetConsoleFlags(nullptr, AI_LOG_ALL);
AiBegin();

AiASSLoad("scene.ass");
AiSceneLoad(nullptr, "scene.ass", nullptr);
AtUniverse *proc_universe = AiUniverse();
AtNode *proc = AiNode(proc_universe, "usd", "usd_proc");
AtArray *array = AiArrayAllocate(1, 1, AI_TYPE_STRING);
Expand All @@ -24,7 +24,7 @@ int main(int argc, char **argv)
AiProceduralViewport(proc, nullptr, AI_PROC_POLYGONS);

AiUniverseDestroy(proc_universe);
AiRender();
AiRender(nullptr);

AiEnd();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0146/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0147/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0148/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

int main(int argc, char **argv)
{
AiMsgSetConsoleFlags(AI_LOG_ALL);
AiMsgSetConsoleFlags(nullptr, AI_LOG_ALL);
AiBegin();
AiSceneLoad(nullptr, "scene.ass", nullptr);
AiSceneWrite(nullptr, "scene_exported.usda", nullptr);
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0152/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0153/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0154/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0155/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_0156/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
AiBegin();
AiMsgSetConsoleFlags(AI_LOG_NONE);
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
auto result = RUN_ALL_TESTS();
AiEnd();
return result;
Expand Down
6 changes: 3 additions & 3 deletions testsuite/test_0161/data/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

int main(int argc, char **argv)
{
AiMsgSetConsoleFlags(AI_LOG_ALL);
AiMsgSetConsoleFlags(nullptr, AI_LOG_ALL);
AiBegin();

AiASSLoad("scene.ass");
AiSceneLoad(nullptr, "scene.ass", nullptr);
AtUniverse *proc_universe = AiUniverse();
AtNode *proc = AiNode(proc_universe, "usd", "usd_proc");
AiNodeSetStr(proc, "filename", "nested_proc.usda");
Expand All @@ -22,7 +22,7 @@ int main(int argc, char **argv)
AiProceduralViewport(proc2, nullptr, AI_PROC_POLYGONS);

AiUniverseDestroy(proc_universe);
AiRender();
AiRender(nullptr);

AiEnd();
return 0;
Expand Down
Loading

0 comments on commit 13ac513

Please sign in to comment.