浏览代码

Namespace Cleanup + Documentation base Files + More Accessibility

/main
Thomas ICHÉ 5 年前
当前提交
0e5170a0
共有 13 个文件被更改,包括 65 次插入62 次删除
  1. 69
      Editor/Canvas/VFXToolboxCanvas.cs
  2. 2
      Editor/Utility/FilterPopupWindow.cs
  3. 6
      ImageSequencer/Editor/Exporters/MiniEXR.cs
  4. 4
      ImageSequencer/Editor/Exporters/MiniTGA.cs
  5. 5
      ImageSequencer/Editor/ImageSequencer.Export.cs
  6. 2
      ImageSequencer/Editor/ImageSequencer.GUI.cs
  7. 24
      ImageSequencer/Editor/ImageSequencerCanvas.cs
  8. 2
      PropertyAttributes/FloatSliderAttribute.cs
  9. 1
      Documentation~/TableOfContents.md
  10. 3
      Documentation~/index.md
  11. 9
      Editor/Examples.meta

69
Editor/Canvas/VFXToolboxCanvas.cs


{
public abstract class VFXToolboxCanvas
{
public Rect displayRect
internal Rect displayRect
public bool maskR
internal bool maskR
{
get { return m_Material.GetColor("_RGBAMask").r == 1.0f; }
set

}
}
public bool maskG
internal bool maskG
{
get { return m_Material.GetColor("_RGBAMask").g == 1.0f; }
set

}
}
public bool maskB
internal bool maskB
{
get { return m_Material.GetColor("_RGBAMask").b == 1.0f; }
set

}
public bool maskA
internal bool maskA
{
get { return m_Material.GetColor("_RGBAMask").a == 1.0f; }
set

}
}
public bool filter
internal bool filter
{
get { return m_bFilter; }
set {

}
}
public int mipMap
internal int mipMap
{
get {
return m_MipMap;

}
}
public int mipMapCount
internal int mipMapCount
public bool showGrid
internal bool showGrid
{
get
{

}
}
public float BackgroundBrightness
internal float BackgroundBrightness
{
get
{

}
}
public Styles styles
internal Styles styles
{
get
{

}
}
/// <summary>
/// The current Zoom Level
/// </summary>
public float zoom
{
get

private bool m_bNeedRedraw;
private float m_bgBrightness = -1.0f;
/// <summary>
/// The currently previewed Texture
/// </summary>
public Texture texture
{
get { return GetTexture(); }

public CanvasGUIDelegate onCanvasGUI;
public delegate void CanvasGUIDelegate();
internal CanvasGUIDelegate onCanvasGUI;
internal delegate void CanvasGUIDelegate();
public VFXToolboxCanvas(Rect displayRect, string shaderName = "Packages/com.unity.vfx-toolbox/Editor/Canvas/Shaders/VFXToolboxCanvas.shader")
internal VFXToolboxCanvas(Rect displayRect, string shaderName = "Packages/com.unity.vfx-toolbox/Editor/Canvas/Shaders/VFXToolboxCanvas.shader")
{
m_Rect = displayRect;

m_RenderTexture = RenderTexture.GetTemporary(1,1,0);
}
public virtual void Invalidate(bool needRedraw)
internal virtual void Invalidate(bool needRedraw)
{
m_bNeedRedraw = m_bNeedRedraw | needRedraw;
}

return 0;
}
public void InvalidateRenderTarget()
internal void InvalidateRenderTarget()
private void UpdateRenderTarget()
internal void UpdateRenderTarget()
{
int width = Mathf.Max(1, texture.width / (int)Mathf.Pow(2, (mipMap)));
int height = Mathf.Max(1, texture.height / (int)Mathf.Pow(2, (mipMap)));

Invalidate(true);
}
public void Recenter(bool Refit)
internal void Recenter(bool Refit)
{
m_CameraPosition = Vector2.zero;
if(Refit)

ScaleMode.ScaleToFit
);
}
/// <summary>
/// Helper Function that converts a Canvas Position to a Screen Position based on the current Canvas Position and Zoom
/// </summary>
/// <param name="Position">Position in Canvas Space</param>
/// <returns>Position in Screen Space</returns>
public Vector2 CanvasToScreen(Vector2 Position)
{
return new Vector2(

// Restore GUI RenderTarget
RenderTexture.active = oldrendertarget;
}
public virtual void OnGUI()
internal virtual void OnGUI()
{
if(m_bgBrightness < 0.0f)

#region BRIGHTNESS CONTROLS
public Texture2D BackgroundTexture { get { return m_BackgroundTexture; } }
internal Texture2D BackgroundTexture { get { return m_BackgroundTexture; } }
public void SetBGBrightness(float value)
internal void SetBGBrightness(float value)
public void ResetBrightness()
internal void ResetBrightness()
{
if (EditorGUIUtility.isProSkin)
BackgroundBrightness = 0.2f;

public void BrightnessUp(float value)
internal void BrightnessUp(float value)
public void BrightnessDown(float value)
internal void BrightnessDown(float value)
{
BackgroundBrightness = Mathf.Max(0.0f, BackgroundBrightness - value);
}

#region STYLES
public class Styles
internal class Styles
{
public GUIStyle miniLabel
{

2
Editor/Utility/FilterPopupWindow.cs


}
public struct DisabledScope : IDisposable
internal struct DisabledScope : IDisposable
{
private static Stack<bool> s_EnabledStack = new Stack<bool>();
bool m_Disposed;

6
ImageSequencer/Editor/Exporters/MiniEXR.cs


// Writes OpenEXR RGB files out of half-precision RGBA or RGB data.
//
namespace MiniEXR {
namespace VFXToolbox.MiniEXR {
//Based on source-forge project: http://sourceforge.net/projects/csharp-half/
internal static class HalfHelper
{

return result;
}
}
public static class MiniEXR {
internal static class MiniEXR {
// Writes EXR into a memory buffer.
// Input:

4
ImageSequencer/Editor/Exporters/MiniTGA.cs


using UnityEngine;
using UnityEditor.VFXToolbox;
namespace MiniTGA
namespace VFXToolbox.MiniTGA
public static class MiniTGA
internal static class MiniTGA
{
// Writes TGA into a memory buffer.
// Input:

5
ImageSequencer/Editor/ImageSequencer.Export.cs


using UnityEngine;
using System.IO;
using VFXToolbox.MiniTGA;
namespace UnityEditor.VFXToolbox.ImageSequencer
{

break;
case ImageSequence.ExportMode.Targa:
{
bytes = MiniTGA.MiniTGA.MiniTGAWrite((ushort)frame.texture.width, (ushort)frame.texture.height, settings.exportAlpha, inputs);
bytes = MiniTGA.MiniTGAWrite((ushort)frame.texture.width, (ushort)frame.texture.height, settings.exportAlpha, inputs);
}
break;
case ImageSequence.ExportMode.PNG:

float a = inputs[k].a;
inputs[k] = new Color(a, a, a, a);
}
MiniTGA.MiniTGA.MiniTGAWrite(alphaFilename,(ushort)frame.texture.width, (ushort)frame.texture.height, false, inputs);
MiniTGA.MiniTGAWrite(alphaFilename,(ushort)frame.texture.width, (ushort)frame.texture.height, false, inputs);
AssetDatabase.Refresh();

2
ImageSequencer/Editor/ImageSequencer.GUI.cs


{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Label(VFXToolboxGUIUtility.Get("Frame Processor Stack"),EditorStyles.boldLabel,GUILayout.Width(180));
GUILayout.Label(VFXToolboxGUIUtility.Get("Frame Processors"),EditorStyles.boldLabel,GUILayout.Width(180));
GUILayout.FlexibleSpace();
if(GUILayout.Button(VFXToolboxGUIUtility.Get("Clear"), GUILayout.Width(80)))
{

24
ImageSequencer/Editor/ImageSequencerCanvas.cs


{
public class ImageSequencerCanvas : VFXToolboxCanvas
{
public bool showExtraInfo
internal bool showExtraInfo
{
get
{

}
}
public int numFrames
internal int numFrames
{
get
{

internal ProcessingFrameSequence sequence
{
get

}
}
public int currentFrameIndex
internal int currentFrameIndex
{
get
{

}
}
public bool isPlaying
internal bool isPlaying
{
get
{

m_PlayControlsRect = new Rect(16, 16, 420, 26);
}
public override void Invalidate(bool needRedraw)
internal override void Invalidate(bool needRedraw)
protected override void SetTexture(Texture tex)
protected override sealed void SetTexture(Texture tex)
protected override Texture GetTexture()
protected override sealed Texture GetTexture()
{
if (currentFrame != null)
{

return null;
}
protected override int GetMipMapCount()
protected override sealed int GetMipMapCount()
{
if (currentFrame != null)
return currentFrame.mipmapCount;

protected override void HandleKeyboardEvents()
protected override sealed void HandleKeyboardEvents()
{
base.HandleKeyboardEvents();

}
}
protected override void DrawGrid()
protected override sealed void DrawGrid()
{
int GridNumU = m_PreviewSequence.numU;
int GridNumV = m_PreviewSequence.numV;

}
}
public void UpdateCanvasSequence()
internal void UpdateCanvasSequence()
{
int length;
if (sequence.processingNode != null)

2
PropertyAttributes/FloatSliderAttribute.cs


namespace UnityEngine.VFXToolbox
{
public class FloatSliderAttribute : PropertyAttribute
internal class FloatSliderAttribute : PropertyAttribute
{
public float m_ValueMin;
public float m_ValueMax;

1
Documentation~/TableOfContents.md


* [VFX Toolbox](Index.md)

3
Documentation~/index.md


# VFX Toolbox
Documentation is Work in Progress

9
Editor/Examples.meta


fileFormatVersion: 2
guid: cb01cd6b53c5afb4e932d16ea337934c
folderAsset: yes
timeCreated: 1475064740
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存