예제 #1
0
    // This causes the current paint operation to get applied to the specified result
    public bool Paint(P3D_Brush brush, P3D_Result result, P3D_CoordType coord = P3D_CoordType.UV1)
    {
        if (result != null)
        {
            return(Paint(brush, result.GetUV(coord)));
        }

        return(false);
    }
예제 #2
0
    private void ShowBrushPreview(P3D_Result result)
    {
        var width      = currentTexture.width;
        var height     = currentTexture.height;
        var uv         = result.GetUV(P3D_CoordType.UV1);
        var xy         = P3D_Helper.CalculatePixelFromCoord(uv, CurrentTiling, CurrentOffset, width, height);
        var matrix     = P3D_Helper.CreateMatrix(xy + new Vector2(0.01f, 0.01f), currentBrush.Size * 0.999f, currentBrush.Angle).Inverse;
        var resolution = new Vector2(width, height);

        P3D_BrushPreview.Show(lockedMesh, currentMaterialIndex, lockedGameObject.transform, previewBrushOpacity, matrix, resolution, currentBrush.Shape, CurrentTiling, CurrentOffset);
    }
예제 #3
0
 public void Paint(P3D_Brush brush, P3D_Result result, int groupMask = -1)
 {
     if ((result != null) && (this.Textures != null))
     {
         for (int i = this.Textures.Count - 1; i >= 0; i--)
         {
             P3D_PaintableTexture texture = this.Textures[i];
             if ((texture != null) && P3D_Helper.IndexInMask((int)texture.Group, groupMask))
             {
                 texture.Paint(brush, result.GetUV(texture.Coord));
             }
         }
     }
 }
예제 #4
0
    // This will paint the current paintable at the result with the specified coord
    public void Paint(P3D_Brush brush, P3D_Result result, int groupMask = -1)
    {
        if (Textures != null)
        {
            for (var i = Textures.Count - 1; i >= 0; i--)
            {
                var texture = Textures[i];

                if (texture != null && P3D_Helper.IndexInMask(texture.Group, groupMask))
                {
                    texture.Paint(brush, result.GetUV(texture.Coord));
                }
            }
        }
    }
예제 #5
0
 public bool Paint(P3D_Brush brush, P3D_Result result, P3D_CoordType coord = 0) =>
 (result != null) && this.Paint(brush, result.GetUV(coord));