export data flag, fix android create dir
This commit is contained in:
@@ -686,7 +686,9 @@ void NodePanelBrushPreset::add_brush(std::shared_ptr<Brush> brush)
|
||||
|
||||
bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo& info_data)
|
||||
{
|
||||
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)$)");
|
||||
LOG("export ppbr to: %s", path.c_str());
|
||||
|
||||
std::regex r(R"((.*)[\\/]([^\\/]+)(\.\w+)?$)");
|
||||
std::smatch m;
|
||||
if (!std::regex_search(path, m, r))
|
||||
return false;
|
||||
@@ -695,7 +697,7 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo&
|
||||
auto ext = m[3].str();
|
||||
std::string out_path = base + "/" + name + "_data";
|
||||
|
||||
bool path_created = Asset::create_dir(out_path);
|
||||
bool path_created = info_data.export_data ? Asset::create_dir(out_path) : false;
|
||||
|
||||
std::ofstream f(path, std::ios::binary);
|
||||
if (f.good())
|
||||
@@ -805,6 +807,7 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo&
|
||||
|
||||
return true;
|
||||
}
|
||||
LOG("export failed file creation");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user