Skip to content

Commit

Permalink
Enable state was not taken into account when pasting a Block (Unity-T…
Browse files Browse the repository at this point in the history
…echnologies#6575)

* Enable state was not taken into account when pasting a Block

* Take enabled/disabled state into account when creating subgraphs

* Updated changelog
  • Loading branch information
julienamsellem committed Dec 16, 2021
1 parent 7647e11 commit b4f512b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions com.unity.visualeffectgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Creating a new VFX of the same name as an already opened VFX will reuse the existing window [Case 1382841](https://issuetracker.unity3d.com/product/unity/issues/guid/1382841/)
- Incorrect behavior of Tangent Space in ShaderGraph [Case 1363279](https://issuetracker.unity3d.com/product/unity/issues/guid/1363279/)
- ShaderGraph made with new VFX SG integration where not listed when searching for a shader graph output [Case 1379523](https://issuetracker.unity3d.com/product/unity/issues/guid/1379523/)
- Enable/disable state of VFX blocks and operators are preserved after copy/paste


## [13.1.2] - 2021-11-05

Expand Down
6 changes: 3 additions & 3 deletions com.unity.visualeffectgraph/Editor/GraphView/Views/VFXCopy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ NodeID CopyNode(ref Node node, VFXModel model, uint index)
// Copy node infos
node.position = model.position;
node.type = model.GetType();
node.flags = 0;
node.flags = (model as VFXBlock)?.enabled != false ? Node.Flags.Enabled : 0;
if (model.collapsed)
node.flags = Node.Flags.Collapsed;
node.flags |= Node.Flags.Collapsed;
if (model.superCollapsed)
node.flags = Node.Flags.SuperCollapsed;
node.flags |= Node.Flags.SuperCollapsed;

uint id = 0;
if (model is VFXOperator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ private int PasteBlocks(VFXViewController viewController, Node[] blocks, VFXCont
{
Node blk = block;
VFXBlock newBlock = PasteAndInitializeNode<VFXBlock>(viewController, ref blk);
newBlock.enabled = (blk.flags & Node.Flags.Enabled) == Node.Flags.Enabled;

if (targetModelContext.AcceptChild(newBlock, targetIndex))
{
Expand Down

0 comments on commit b4f512b

Please sign in to comment.