diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-04-17 08:01:13 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-04-29 20:19:19 +0300 |
commit | 9b92ce9dc00971cd9f7f0d0ba6109a9cba2090bd (patch) | |
tree | ba6189d6c4a8872f4cc48a88c5a39730012c44b2 /intern/cycles/app/cycles_standalone.cpp | |
parent | 060a50a5f72a0ccdb754bf155aa2ed394a1bcda5 (diff) |
Cycles: add USD as a file format for Cycles standalone rendering
Long term, this should replace the XML format. This reuses the Hydra render
delegate implementation, and so supports the same features. The same command
line options and GUI work for both XML and USD also.
The implementation of this is still disabled, waiting for some refactoring of
USD library linking. However we want the Cycles code to be in sync between
repositories for the 3.2 release.
Ref T96731
Diffstat (limited to 'intern/cycles/app/cycles_standalone.cpp')
-rw-r--r-- | intern/cycles/app/cycles_standalone.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index 87ab84eb209..8b40adc8d92 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -23,6 +23,10 @@ #include "util/unique_ptr.h" #include "util/version.h" +#ifdef WITH_USD +# include "hydra/file_reader.h" +#endif + #include "app/cycles_xml.h" #include "app/oiio_output_driver.h" @@ -94,8 +98,16 @@ static void scene_init() { options.scene = options.session->scene; - /* Read XML */ - xml_read_file(options.scene, options.filepath.c_str()); + /* Read XML or USD */ +#ifdef WITH_USD + if (!string_endswith(string_to_lower(options.filepath), ".xml")) { + HD_CYCLES_NS::HdCyclesFileReader::read(options.session, options.filepath.c_str()); + } + else +#endif + { + xml_read_file(options.scene, options.filepath.c_str()); + } /* Camera width/height override? */ if (!(options.width == 0 || options.height == 0)) { |