Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement of multi-select edit. #159

Merged
merged 7 commits into from
Jan 11, 2023
4 changes: 2 additions & 2 deletions source/creator/actions/mesheditor.d
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ public:
if (isApplyable()) {
if (oldPathPoints !is null && oldPathPoints.length > 0 && path !is null) {
path.points = oldPathPoints.dup;
path.update();
path.update(); /// FIX ME: we need to recreate path object if needed.
}
if (oldTargetPathPoints !is null && oldTargetPathPoints.length > 0 && path !is null && path.target !is null) {
path.target.points = oldTargetPathPoints.dup;
path.target.update();
path.target.update(); /// FIX ME: we need to recreate path object if needed.
}
}
super.rollback();
Expand Down
1 change: 1 addition & 0 deletions source/creator/viewport/common/mesheditor.d
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ public:
p.points[i].position = (tr * (invTr * vec4(p.points[i].position, 0, 1))).xy;
}
p.update();
p.remapTarget(mesh);
return p;
}
if (path) {
Expand Down
14 changes: 10 additions & 4 deletions source/creator/viewport/common/spline.d
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ public:
target.points = points.dup;
target.interpolate();

refMesh.length = 0;
foreach(ref MeshVertex* vtx; reference.vertices) {
refMesh ~= vtx.position;
remapTarget(reference);
}

void remapTarget(IncMesh reference) {
if (target !is null) {
refMesh.length = 0;
foreach(ref MeshVertex* vtx; reference.vertices) {
refMesh ~= vtx.position;
}
mapReference();
}
mapReference();
}

void mapReference() {
Expand Down