Skip to content

Commit

Permalink
Add LayoutGroup to import/ecport for CustomModel xLightsSequencer#4478
Browse files Browse the repository at this point in the history
  • Loading branch information
cybercop23 committed Apr 9, 2024
1 parent de42fcb commit e6caa43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xLights/models/CustomModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ void CustomModel::ImportXlightsModel(wxXmlNode* root, xLightsFrame* xlights, flo
wxString pc = root->GetAttribute("PixelCount");
wxString pt = root->GetAttribute("PixelType");
wxString psp = root->GetAttribute("PixelSpacing");
wxString lg = root->GetAttribute("LayoutGroup");

// generally xmodels dont have these ... but there are some cases where we do where it would point to a shadow model ... in those cases we want to bring it in
wxString smf = root->GetAttribute("ShadowModelFor");
Expand All @@ -1151,6 +1152,7 @@ void CustomModel::ImportXlightsModel(wxXmlNode* root, xLightsFrame* xlights, flo
SetProperty("PixelCount", pc);
SetProperty("PixelType", pt);
SetProperty("PixelSpacing", psp);
SetProperty("LayoutGroup", lg);
if (smf != "") {
SetProperty("ShadowModelFor", smf);
}
Expand Down Expand Up @@ -1429,6 +1431,7 @@ void CustomModel::ExportXlightsModel()
wxString a = ModelXml->GetAttribute("Antialias");
wxString sn = ModelXml->GetAttribute("StrandNames");
wxString nn = ModelXml->GetAttribute("NodeNames");
wxString lg = ModelXml->GetAttribute("LayoutGroup");
wxString v = xlights_version_string;

f.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<custommodel \n");
Expand All @@ -1443,6 +1446,7 @@ void CustomModel::ExportXlightsModel()
f.Write(wxString::Format("Antialias=\"%s\" ", a));
f.Write(wxString::Format("StrandNames=\"%s\" ", sn));
f.Write(wxString::Format("NodeNames=\"%s\" ", nn));
f.Write(wxString::Format("LayoutGroup=\"%s\" ", lg));
f.Write("CustomModel=\"");
f.Write(cm);
f.Write("\" ");
Expand Down
2 changes: 2 additions & 0 deletions xLights/models/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4850,6 +4850,7 @@ void Model::ExportAsCustomXModel() const
wxString pc = ModelXml->GetAttribute("PixelCount");
wxString pt = ModelXml->GetAttribute("PixelType");
wxString psp = ModelXml->GetAttribute("PixelSpacing");
wxString lg = ModelXml->GetAttribute("LayoutGroup");

wxString v = xlights_version_string;
f.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<custommodel \n");
Expand All @@ -4870,6 +4871,7 @@ void Model::ExportAsCustomXModel() const
f.Write(wxString::Format("PixelType=\"%s\" ", pt));
if (psp != "")
f.Write(wxString::Format("PixelSpacing=\"%s\" ", psp));
f.Write(wxString::Format("LayoutGroup=\"%s\" ", lg));
f.Write("CustomModel=\"");
f.Write(cm);
f.Write("\" ");
Expand Down

0 comments on commit e6caa43

Please sign in to comment.