Skip to content

Commit

Permalink
Split XML project file reading and writing.
Browse files Browse the repository at this point in the history
  • Loading branch information
est77 committed Apr 19, 2020
1 parent dcea65f commit 55547fc
Show file tree
Hide file tree
Showing 11 changed files with 4,620 additions and 4,336 deletions.
25 changes: 13 additions & 12 deletions src/appleseed.python/bindproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,27 +248,28 @@ namespace
}

bpy::object project_file_reader_read_default_opts(
ProjectFileReader* reader,
const char* project_filename,
const char* schema_filename)
{
auto_release_ptr<Project> project(reader->read(project_filename, schema_filename));
auto_release_ptr<Project> project(
ProjectFileReader::read(project_filename, schema_filename));
return bpy::object(project);
}

bpy::object project_file_reader_read_with_opts(
ProjectFileReader* reader,
const char* project_filename,
const char* schema_filename,
const ProjectFileReader::Options opts)
{
auto_release_ptr<Project> project(reader->read(project_filename, schema_filename, opts));
auto_release_ptr<Project> project(
ProjectFileReader::read(project_filename, schema_filename, opts));
return bpy::object(project);
}

bpy::object project_file_reader_load_builtin(ProjectFileReader* reader, const char* project_name)
bpy::object project_file_reader_load_builtin(const char* project_name)
{
auto_release_ptr<Project> project(reader->load_builtin(project_name));
auto_release_ptr<Project> project(
ProjectFileReader::load_builtin(project_name));
return bpy::object(project);
}

Expand Down Expand Up @@ -353,9 +354,9 @@ void bind_project()
.value("OmitProjectSchemaValidation", ProjectFileReader::OmitProjectSchemaValidation);

bpy::class_<ProjectFileReader>("ProjectFileReader")
.def("read", &project_file_reader_read_default_opts)
.def("read", &project_file_reader_read_with_opts)
.def("load_builtin", &project_file_reader_load_builtin);
.def("read", &project_file_reader_read_default_opts).staticmethod("read")
.def("read", &project_file_reader_read_with_opts).staticmethod("read")
.def("load_builtin", &project_file_reader_load_builtin).staticmethod("load_builtin");

bpy::enum_<ProjectFileWriter::Options>("ProjectFileWriterOptions")
.value("Defaults", ProjectFileWriter::Defaults)
Expand All @@ -366,7 +367,7 @@ void bind_project()

bpy::class_<ProjectFileWriter>("ProjectFileWriter")
// These methods are static but for symmetry with ProjectFileReader we're exposing them as non-static.
.def("write", write_project_default_opts)
.def("write", write_project_with_opts)
.def("write", write_project_with_opts_and_comments);
.def("write", write_project_default_opts).staticmethod("write")
.def("write", write_project_with_opts).staticmethod("write")
.def("write", write_project_with_opts_and_comments).staticmethod("write");
}
1 change: 1 addition & 0 deletions src/appleseed.qtcommon/project/projectmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

// appleseed.foundation headers.
#include "foundation/platform/compiler.h"
#include "foundation/utility/searchpaths.h"

// Qt headers.
#include <QFutureWatcher>
Expand Down
4 changes: 4 additions & 0 deletions src/appleseed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,10 @@ set (renderer_modeling_project_sources
renderer/modeling/project/projecttracker.cpp
renderer/modeling/project/projecttracker.h
renderer/modeling/project/renderingtimer.h
renderer/modeling/project/xmlprojectfilereader.cpp
renderer/modeling/project/xmlprojectfilereader.h
renderer/modeling/project/xmlprojectfilewriter.cpp
renderer/modeling/project/xmlprojectfilewriter.h
)
list (APPEND appleseed_sources
${renderer_modeling_project_sources}
Expand Down
Loading

0 comments on commit 55547fc

Please sign in to comment.