Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions com.unity.shadergraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this package are documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [10.x.x]

### Added
- ShaderGraph BoneIndex & BoneWeight nodes

## [10.9.0] - 2021-12-06

Version Updated
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEditor.ShaderGraph.Internal;

namespace UnityEditor.ShaderGraph
{
[FormerName("UnityEngine.MaterialGraph.BoneIndexNode")]
[Title("Input", "Geometry", "BoneIndex")]
class BoneIndexNode : AbstractMaterialNode, IMayRequireVertexSkinning
{
public override int latestVersion => 1;
private const int kOutputSlotId = 0;
public const string kOutputSlotName = "Out";
//public override List<CoordinateSpace> validSpaces => new List<CoordinateSpace> { CoordinateSpace.Object };

public BoneIndexNode()
{
name = "BoneIndex";
precision = Precision.Single;
UpdateNodeAfterDeserialization();
}


public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector4MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));
RemoveSlotsNameNotMatching(new[] { kOutputSlotId });
}

public override string GetVariableNameForSlot(int slotId)
{
return "IN.BoneIndices";
}

public bool RequiresVertexSkinning(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
return true;
}

public override void OnAfterMultiDeserialize(string json)
{
base.OnAfterMultiDeserialize(json);
//required update
if(sgVersion < 1)
{
ChangeVersion(1);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEditor.ShaderGraph.Internal;

namespace UnityEditor.ShaderGraph
{
[FormerName("UnityEngine.MaterialGraph.BoneWeightNode")]
[Title("Input", "Geometry", "BoneWeight")]
class BoneWeightNode : AbstractMaterialNode, IMayRequireVertexSkinning
{
public override int latestVersion => 1;
private const int kOutputSlotId = 0;
public const string kOutputSlotName = "Out";
//public override List<CoordinateSpace> validSpaces => new List<CoordinateSpace> { CoordinateSpace.Object };

public BoneWeightNode()
{
name = "BoneWeight";
precision = Precision.Single;
UpdateNodeAfterDeserialization();
}


public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector4MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));
RemoveSlotsNameNotMatching(new[] { kOutputSlotId });
}

public override string GetVariableNameForSlot(int slotId)
{
return "IN.BoneWeights";
}

public bool RequiresVertexSkinning(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
return true;
}

public override void OnAfterMultiDeserialize(string json)
{
base.OnAfterMultiDeserialize(json);
//required update
if(sgVersion < 1)
{
ChangeVersion(1);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.