浏览代码

[mat graph]Fix issue with edges not behaving well

/main
Tim Cooper 8 年前
当前提交
1c332af5
共有 21 个文件被更改,包括 42 次插入386 次删除
  1. 2
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/EdgeConnector.cs
  2. 255
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.imported.asset
  3. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset
  4. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset.meta
  5. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset
  6. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset.meta
  7. 2
      MaterialGraphProject/Assets/NewUI/Editor/Elements/Data/EdgeData.cs
  8. 72
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss.imported.asset
  9. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/DrawData/MaterialGraphDataSource.cs
  10. 44
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphPreviewGenerator.cs
  11. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.imported.asset.meta
  12. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/2DPreview.template
  13. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TextureNode.cs
  14. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UVNode.cs
  15. 9
      MaterialGraphProject/Assets/NewUI/Editor/Demo/GraphElements.meta
  16. 9
      MaterialGraphProject/Assets/NewUI/Editor/Graph.meta
  17. 9
      MaterialGraphProject/Assets/NewUI/Editor/GraphElements.meta
  18. 9
      MaterialGraphProject/Assets/NewUI/Editor/GraphElementsData.meta

2
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/EdgeConnector.cs


foreach (var c in three)
{
if (!c.IsConnectable())
continue;
if (c.orientation != cnx.orientation)
continue;
if(c.direction == cnx.direction)

255
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.imported.asset


m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: SerializableGraph.uss.imported
m_EditorClassIdentifier:
matchers:
- specificity: 2
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 102
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: 2
- specificity: 102
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 1
depth: 2147483647
previousIndex: 1
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 2
depth: 2147483647
previousIndex: -1
nextIndex: 4
- specificity: 202
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 2
depth: 2147483647
previousIndex: 3
nextIndex: 5
- specificity: 202
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 2
depth: 2147483647
previousIndex: 4
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 3
depth: 2147483647
previousIndex: -1
nextIndex: 7
- specificity: 202
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 3
depth: 2147483647
previousIndex: 6
nextIndex: 8
- specificity: 202
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 3
depth: 2147483647
previousIndex: 7
nextIndex: -1
- specificity: 102
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 4
depth: 2147483647
previousIndex: -1
nextIndex: 10
- specificity: 102
selectorValues:
- controls
selectorTypes: 06000000
ruleIndex: 4
depth: 2147483647
previousIndex: 9
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 5
depth: 2147483647
previousIndex: -1
nextIndex: 12
- specificity: 202
selectorValues:
- controls
selectorTypes: 06000000
ruleIndex: 5
depth: 2147483647
previousIndex: 11
nextIndex: 13
- specificity: 202
selectorValues:
- element
selectorTypes: 06000000
ruleIndex: 5
depth: 2147483647
previousIndex: 12
nextIndex: -1
- specificity: 2
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 6
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 102
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 7
depth: 2147483647
previousIndex: -1
nextIndex: 16
- specificity: 102
selectorValues:
- preview
selectorTypes: 06000000
ruleIndex: 7
depth: 2147483647
previousIndex: 15
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 8
depth: 2147483647
previousIndex: -1
nextIndex: 18
- specificity: 202
selectorValues:
- preview
selectorTypes: 06000000
ruleIndex: 8
depth: 2147483647
previousIndex: 17
nextIndex: 19
- specificity: 202
selectorValues:
- image
selectorTypes: 06000000
ruleIndex: 8
depth: 2147483647
previousIndex: 18
nextIndex: -1
- specificity: 2
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 9
depth: 2147483647
previousIndex: -1
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 0
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 1
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 0
- type: 1
propertyID: 26
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 1
- type: 1
propertyID: 26
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 4
- type: 0
propertyID: 7
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 4
- type: 0
propertyID: 17
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
floats:
- 1
- 1
- 2
- 26
- 200
- 200
- 26
ints: 00000000020000000000000000000000000000000000000000000000
matchers: []
rules: []
floats: []
ints:
bools:
colors: []
strings: []

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: NodalView.uss.imported
m_Name:
m_EditorClassIdentifier:
matchers:
- specificity: 102

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset.meta


fileFormatVersion: 2
guid: ae904e6b00e321143b960221024f7fc3
timeCreated: 1478070317
timeCreated: 1478440368
licenseType: Pro
NativeFormatImporter:
userData:

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: SimpleContentView.uss.imported
m_Name:
m_EditorClassIdentifier:
matchers:
- specificity: 2

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset.meta


fileFormatVersion: 2
guid: fbe164d03ec59254eafe10baa5a9c5ba
timeCreated: 1478070327
timeCreated: 1478440368
licenseType: Pro
NativeFormatImporter:
userData:

2
MaterialGraphProject/Assets/NewUI/Editor/Elements/Data/EdgeData.cs


protected new void OnEnable()
{
base.OnEnable();
capabilities = Capabilities.Deletable;
capabilities = Capabilities.Deletable | Capabilities.Selectable;
}
protected EdgeData() {}

72
MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss.imported.asset


m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: GraphView.uss.imported
m_EditorClassIdentifier:
matchers:
- specificity: 11
selectorValues:
- graphElement
selectorTypes: 03000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 21
selectorValues:
- graphElement
- selected
selectorTypes: 0300000003000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 1
propertyID: 32
valueIndex: 0
- type: 3
propertyID: 40
valueIndex: 0
- type: 0
propertyID: 8
valueIndex: 0
- type: 0
propertyID: 9
valueIndex: 1
- type: 0
propertyID: 10
valueIndex: 2
- type: 0
propertyID: 11
valueIndex: 3
- type: 0
propertyID: 24
valueIndex: 4
- type: 0
propertyID: 25
valueIndex: 5
- type: 3
propertyID: 41
valueIndex: 1
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 42
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
floats:
- 2
- 2
- 2
- 2
- 2
- 5
ints: 01000000
matchers: []
rules: []
floats: []
ints:
colors:
- {r: 1, g: 1, b: 1, a: 1}
- {r: 0.2, g: 0.2, b: 0.2, a: 1}
- {r: 1, g: 1, b: 0, a: 1}
colors: []
strings: []
assets: []

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/DrawData/MaterialGraphDataSource.cs


using UnityEditor.Graphing.Drawing;
using UnityEngine.MaterialGraph;
using RMGUI.GraphView;
namespace UnityEditor.MaterialGraph.Drawing
{

AddTypeMapping(typeof(Vector2Node), typeof(Vector2NodeDrawData));
AddTypeMapping(typeof(Vector3Node), typeof(Vector3NodeDrawData));
AddTypeMapping(typeof(Vector4Node), typeof(Vector4NodeDrawData));
AddTypeMapping(typeof(EdgeDrawData), typeof(Edge));
}
}
}

44
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphPreviewGenerator.cs


{
m_PreviewUtility.m_Camera.transform.position = -Vector3.forward * 5;
m_PreviewUtility.m_Camera.transform.rotation = Quaternion.identity;
EditorUtility.SetCameraAnimateMaterialsTime(m_PreviewUtility.m_Camera, time);
var amb = new Color(.2f, .2f, .2f, 0);
m_PreviewUtility.m_Light[0].intensity = 1.0f;
m_PreviewUtility.m_Light[0].transform.rotation = Quaternion.Euler(50f, 50f, 0);
m_PreviewUtility.m_Light[1].intensity = 1.0f;
InternalEditorUtility.SetCustomLighting(m_PreviewUtility.m_Light, amb);
m_PreviewUtility.DrawMesh(s_Meshes[0], Vector3.zero, Quaternion.Euler(-20, 0, 0) * Quaternion.Euler(0, 0, 0), mat, 0);
var oldFog = RenderSettings.fog;
Unsupported.SetRenderSettingsUseFogNoDirty(false);
m_PreviewUtility.m_Camera.Render();
Unsupported.SetRenderSettingsUseFogNoDirty(oldFog);
InternalEditorUtility.RemoveCustomLighting();
EditorUtility.SetCameraAnimateMaterialsTime(m_PreviewUtility.m_Camera, time);
InternalEditorUtility.SetCustomLighting(m_PreviewUtility.m_Light, Color.black);
m_PreviewUtility.DrawMesh(quad, Matrix4x4.identity, mat, 0);
var oldFog = RenderSettings.fog;
Unsupported.SetRenderSettingsUseFogNoDirty(false);
m_PreviewUtility.m_Camera.Render();
Unsupported.SetRenderSettingsUseFogNoDirty(oldFog);
InternalEditorUtility.RemoveCustomLighting();
EditorUtility.SetCameraAnimateMaterialsTime(m_PreviewUtility.m_Camera, time);
m_PreviewUtility.m_Light[0].intensity = 1.0f;
m_PreviewUtility.m_Light[0].transform.rotation = Quaternion.Euler(50f, 50f, 0);
m_PreviewUtility.m_Light[1].intensity = 1.0f;
InternalEditorUtility.SetCustomLighting(m_PreviewUtility.m_Light, Color.black);
var oldFog = RenderSettings.fog;
Unsupported.SetRenderSettingsUseFogNoDirty(false);
m_PreviewUtility.m_Camera.clearFlags = CameraClearFlags.SolidColor;
m_PreviewUtility.DrawMesh(
mode == PreviewMode.Preview3D ? s_Meshes[0] : quad,
Vector3.zero,
Quaternion.identity,
mat,
0);
m_PreviewUtility.m_Camera.Render();
Unsupported.SetRenderSettingsUseFogNoDirty(oldFog);
InternalEditorUtility.RemoveCustomLighting();
return m_PreviewUtility.EndPreview();
}
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.imported.asset.meta


fileFormatVersion: 2
guid: 13814e9314253674e8d4966bba14d963
timeCreated: 1478262941
timeCreated: 1478440210
licenseType: Pro
NativeFormatImporter:
userData:

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/2DPreview.template


}
SubShader {
Blend One Zero
Pass {
CGPROGRAM
#pragma vertex vert

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TextureNode.cs


if (onModified != null)
{
onModified(this, ModificationScope.Graph);
onModified(this, ModificationScope.Node);
}
}
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UVNode.cs


{ }
[Title("Input/UV Node")]
public class UVNode : AbstractMaterialNode, IGeneratesBodyCode
public class UVNode : AbstractMaterialNode, IGeneratesBodyCode, IRequiresMeshUV
{
public const int OutputSlotId = 0;
private const string kOutputSlotName = "UV";

9
MaterialGraphProject/Assets/NewUI/Editor/Demo/GraphElements.meta


fileFormatVersion: 2
guid: 0cabc6d3555773b46ac210aaf8eefae6
folderAsset: yes
timeCreated: 1475167728
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/NewUI/Editor/Graph.meta


fileFormatVersion: 2
guid: b72798efa4aa8574ca0cbdfa63df0b7a
folderAsset: yes
timeCreated: 1475177616
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/NewUI/Editor/GraphElements.meta


fileFormatVersion: 2
guid: ebb7c69d632722145a1f9d838e7fe6ef
folderAsset: yes
timeCreated: 1475161005
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/NewUI/Editor/GraphElementsData.meta


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