add ppbr info data
This commit is contained in:
@@ -684,7 +684,7 @@ void NodePanelBrushPreset::add_brush(std::shared_ptr<Brush> brush)
|
||||
m_notification->SetVisibility(m_container->m_children.size() == 0);
|
||||
}
|
||||
|
||||
bool NodePanelBrushPreset::export_ppbr(const std::string& path, const Image& header_image)
|
||||
bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo& info_data)
|
||||
{
|
||||
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)$)");
|
||||
std::smatch m;
|
||||
@@ -724,8 +724,12 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const Image& hea
|
||||
info.class_id = "ppbr_info";
|
||||
info.name = L"info header";
|
||||
|
||||
bool has_header_image = header_image.m_data != nullptr;
|
||||
bool has_header_image = info_data.header_image.m_data != nullptr;
|
||||
|
||||
info.props["author"] = std::make_shared<Serializer::String>(info_data.author);
|
||||
info.props["email"] = std::make_shared<Serializer::String>(info_data.email);
|
||||
info.props["url"] = std::make_shared<Serializer::String>(info_data.url);
|
||||
info.props["descr"] = std::make_shared<Serializer::String>(info_data.descr);
|
||||
info.props["has_header_image"] = std::make_shared<Serializer::Boolean>(has_header_image);
|
||||
info.props["num_brush_tips"] = std::make_shared<Serializer::Integer>(img_brushes.size());
|
||||
info.props["num_brush_patt"] = std::make_shared<Serializer::Integer>(img_patterns.size());
|
||||
@@ -739,8 +743,8 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const Image& hea
|
||||
// header image
|
||||
if (has_header_image)
|
||||
{
|
||||
sw << header_image;
|
||||
header_image.save_jpg(out_path + "/header.jpg", 75);
|
||||
sw << info_data.header_image;
|
||||
info_data.header_image.save_jpg(out_path + "/header.jpg", 75);
|
||||
}
|
||||
|
||||
pb->increment();
|
||||
|
||||
Reference in New Issue
Block a user