Skip to content

Commit

Permalink
Do not store resource search paths in MasterRendererWrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
est77 committed Mar 27, 2020
1 parent 38e46d8 commit 825956d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/appleseed.python/bindmasterrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ namespace
{
public:
bpy::object m_project_object; // unreferenced but necessary
SearchPaths m_resource_search_paths;
std::unique_ptr<MasterRenderer> m_renderer;

MasterRendererWrapper(
Expand All @@ -67,14 +66,12 @@ namespace
ITileCallbackFactory* tile_callback_factory = nullptr)
: m_project_object(project_object)
{
init_search_paths(m_resource_search_paths, resource_search_paths);

Project* project = bpy::extract<Project*>(project_object);
m_renderer.reset(
new MasterRenderer(
*project,
params,
m_resource_search_paths,
init_search_paths(resource_search_paths),
tile_callback_factory));
}

Expand All @@ -85,22 +82,19 @@ namespace
ITileCallback* tile_callback)
: m_project_object(project_object)
{
init_search_paths(m_resource_search_paths, resource_search_paths);

Project* project = bpy::extract<Project*>(project_object);
m_renderer.reset(
new MasterRenderer(
*project,
params,
m_resource_search_paths,
init_search_paths(resource_search_paths),
tile_callback));
}

private:
static void init_search_paths(
SearchPaths& search_paths,
const bpy::list& paths)
static SearchPaths init_search_paths(const bpy::list& paths)

This comment has been minimized.

Copy link
@dictoon

dictoon Mar 30, 2020

Member

👍

extract_search_paths() would be a better name.

{
SearchPaths search_paths;
for (bpy::ssize_t i = 0, e = bpy::len(paths); i < e; ++i)
{
const bpy::extract<const char*> extractor(paths[i]);
Expand All @@ -112,6 +106,8 @@ namespace
bpy::throw_error_already_set();
}
}

return search_paths;
}
};

Expand Down

0 comments on commit 825956d

Please sign in to comment.