浏览代码

Fixes for previews not updating (#1737)

Added a bool for frame all.
Dirty the nodes after Geometry changed event.
/main
GitHub 6 年前
当前提交
4294530e
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 2
      com.unity.shadergraph/CHANGELOG.md
  2. 9
      com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs

2
com.unity.shadergraph/CHANGELOG.md


- You can now copy, paste, and duplicate sub-graph nodes with vector type input ports.
- The Lightweight PBR subshader now normalizes normal, tangent, and view direction correctly.
- Shader graphs using alpha clip now generate correct depth and shadow passes.
- `Normal Create` node has been renamed to `Normal From Texture`.
- The preview of nodes now updates correctly.

9
com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs


ColorSpace m_ColorSpace;
RenderPipelineAsset m_RenderPipelineAsset;
bool m_FrameAllAfterLayout;
GraphEditorView m_GraphEditorView;

m_GraphEditorView.saveRequested += UpdateAsset;
m_GraphEditorView.convertToSubgraphRequested += ToSubGraph;
m_GraphEditorView.showInProjectRequested += PingAsset;
m_GraphEditorView.RegisterCallback<GeometryChangedEvent>(OnGeometryChanged);
this.GetRootVisualContainer().Add(graphEditorView);
}
}

persistenceKey = selectedGuid,
assetName = asset.name.Split('/').Last()
};
m_FrameAllAfterLayout = true;
graphEditorView.RegisterCallback<GeometryChangedEvent>(OnGeometryChanged);
titleContent = new GUIContent(asset.name.Split('/').Last());

void OnGeometryChanged(GeometryChangedEvent evt)
{
graphEditorView.UnregisterCallback<GeometryChangedEvent>(OnGeometryChanged);
graphEditorView.graphView.FrameAll();
if (m_FrameAllAfterLayout)
graphEditorView.graphView.FrameAll();
m_FrameAllAfterLayout = false;
foreach (var node in m_GraphObject.graph.GetNodes<AbstractMaterialNode>())
node.Dirty(ModificationScope.Node);
}
}
}
正在加载...
取消
保存