Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Fix texture lock when doing Shift+Drag to clone brushes #223

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sledge.Editor/Tools/SelectTool/SelectTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,12 @@ private void ExecuteTransform(string transformationName, IUnitTransformation tra
{
// Copy the selection, transform it, and reselect
var copies = ClipboardManager.CloneFlatHeirarchy(Document, Document.Selection.GetSelectedObjects()).ToList();
// HACK: Load textures now so Face.Transform() texture lock code works
foreach (var face in copies.SelectMany(x => x.FindAll().OfType<Solid>().SelectMany(y => y.Faces)))
{
face.Texture.Texture = Document.GetTexture(face.Texture.Name);
face.CalculateTextureCoordinates(true);
}
foreach (var mo in copies)
{
mo.Transform(transform, Document.Map.GetTransformFlags());
Expand Down