Skip to content

Commit

Permalink
Add stitching UV for other side surface
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi committed Jan 17, 2023
1 parent 6581bbe commit 53f0d63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion application/sources/component_property_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ ComponentPropertyWidget::ComponentPropertyWidget(Document* document,
ImagePreviewWidget* colorImagePreviewWidget = new ImagePreviewWidget;
colorImagePreviewWidget->setFixedSize(Theme::partPreviewImageSize * 2, Theme::partPreviewImageSize * 2);
auto colorImageId = lastColorImageId();
colorImagePreviewWidget->updateImage(colorImageId.isNull() ? QImage() : *ImageForever::get(colorImageId));
const QImage* colorImage = nullptr;
if (!colorImageId.isNull())
colorImage = ImageForever::get(colorImageId);
colorImagePreviewWidget->updateImage(nullptr == colorImage ? QImage() : *colorImage);
QPushButton* colorImageEraser = new QPushButton(Theme::awesome()->icon(fa::eraser), "");
Theme::initIconButton(colorImageEraser);

Expand Down
6 changes: 3 additions & 3 deletions application/sources/document_saver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ void DocumentSaver::process()
void DocumentSaver::collectUsedResourceIds(const dust3d::Snapshot* snapshot,
std::set<dust3d::Uuid>& imageIds)
{
for (const auto& part : snapshot->parts) {
auto findImageIdString = part.second.find("colorImageId");
if (findImageIdString == part.second.end())
for (const auto& componentIt : snapshot->components) {
auto findImageIdString = componentIt.second.find("colorImageId");
if (findImageIdString == componentIt.second.end())
continue;
dust3d::Uuid imageId = dust3d::Uuid(findImageIdString->second);
imageIds.insert(imageId);
Expand Down
5 changes: 5 additions & 0 deletions dust3d/mesh/stitch_mesh_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ void StitchMeshBuilder::build()
oneSideVertexCount + quad[1],
oneSideVertexCount + quad[0],
oneSideVertexCount + quad[3] });
m_generatedFaceUvs.emplace_back(std::vector<Vector2> {
m_generatedFaceUvs[i][2],
m_generatedFaceUvs[i][1],
m_generatedFaceUvs[i][0],
m_generatedFaceUvs[i][3] });
}

// Move all vertices off distance at radius
Expand Down

0 comments on commit 53f0d63

Please sign in to comment.