public TextureTool() { Usage = ToolUsage.View3D; _form = new TextureApplicationForm(); _form.PropertyChanged += TexturePropertyChanged; _form.TextureAlign += TextureAligned; _form.TextureApply += TextureApplied; _form.TextureJustify += TextureJustified; _form.HideMaskToggled += HideMaskToggled; }
public TextureTool() { Usage = ToolUsage.View3D; _form = new TextureApplicationForm(); _form.PropertyChanged += TexturePropertyChanged; _form.TextureAlign += TextureAligned; _form.TextureApply += TextureApplied; _form.TextureJustify += TextureJustified; _form.HideMaskToggled += HideMaskToggled; }
private void TexturePropertyChanged(object sender, TextureApplicationForm.CurrentTextureProperties properties) { Action<Document, Face> action = (document, face) => { if (!properties.DifferentXScaleValues) face.Texture.XScale = properties.XScale; if (!properties.DifferentYScaleValues) face.Texture.YScale = properties.YScale; if (!properties.DifferentXShiftValues) face.Texture.XShift = properties.XShift; if (!properties.DifferentYShiftValues) face.Texture.YShift = properties.YShift; if (!properties.DifferentRotationValues) face.SetTextureRotation(properties.Rotation); face.CalculateTextureCoordinates(false); }; Document.PerformAction("Modify texture properties", new EditFace(Document.Selection.GetSelectedFaces(), action, false)); }