Skip to content

Commit

Permalink
Moved to Unity 2017.1.0b3 API
Browse files Browse the repository at this point in the history
Addpted to API changes in Unity.
  • Loading branch information
jasonm-unity committed May 4, 2017
1 parent 4252795 commit 026d211
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
Expand Up @@ -490,7 +490,7 @@ static void ImportEnumerator(aiObject obj, IntPtr userData)
// Find targetted child GameObj
AlembicTreeNode childTreeNode = null;
GameObject childGO = null;
var childTransf = treeNode.linkedGameObj.transform.FindChild(childName);
var childTransf = treeNode.linkedGameObj.transform.Find(childName);
if (childTransf == null)
{
if (!ic.createMissingNodes)
Expand Down
Expand Up @@ -68,7 +68,7 @@ void Update()

MeshRenderer splitRenderer = null;

Transform split = gameObject.transform.FindChild(gameObject.name + "_split_" + submesh.splitIndex);
Transform split = gameObject.transform.Find(gameObject.name + "_split_" + submesh.splitIndex);

if (split == null)
{
Expand Down Expand Up @@ -213,7 +213,7 @@ public void UpdateAssignments(List<Assignment> assignments)

static GameObject SearchNodeInstance(Transform parent, string name, int instNum, ref int curInst)
{
Transform node = parent.FindChild(name);
Transform node = parent.Find(name);

if (node != null)
{
Expand Down Expand Up @@ -264,7 +264,7 @@ static GameObject FindNode(GameObject root, string path, int instNum)

while (curNode != null && curPath < paths.Length)
{
Transform child = curNode.FindChild(paths[curPath]);
Transform child = curNode.Find(paths[curPath]);

if (child == null)
{
Expand Down
Expand Up @@ -345,7 +345,7 @@ public override void AbcUpdate()
{
string name = AlembicTreeNode.linkedGameObj.name + "_split_" + s;

Transform trans = AlembicTreeNode.linkedGameObj.transform.FindChild(name);
Transform trans = AlembicTreeNode.linkedGameObj.transform.Find(name);

if (trans == null)
{
Expand Down
Expand Up @@ -31,18 +31,17 @@ public class AlembicShotAsset : PlayableAsset, ITimelineClipAsset

public ClipCaps clipCaps { get { return ClipCaps.None; } }

public override PlayableHandle CreatePlayable(PlayableGraph graph, GameObject owner)
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
var handle = graph.CreateScriptPlayable<AlembicShotPlayable>();

var playable = handle.GetObject<AlembicShotPlayable>();
m_Stream = m_StreamPlayer.Resolve(graph.resolver);
playable.streamPlayer = m_Stream;
playable.m_StartTimeOffset = m_StartOffset;
playable.m_EndTimeClipOff = m_EndOffset;
playable.m_TimeScale = m_TimeScale;
playable.m_Cycle = m_Cycle;
return handle;
var playable = ScriptPlayable<AlembicShotPlayable>.Create(graph);
var behaviour = playable.GetBehaviour();
m_Stream = m_StreamPlayer.Resolve(graph.GetResolver());
behaviour.streamPlayer = m_Stream;
behaviour.m_StartTimeOffset = m_StartOffset;
behaviour.m_EndTimeClipOff = m_EndOffset;
behaviour.m_TimeScale = m_TimeScale;
behaviour.m_Cycle = m_Cycle;
return playable;
}

public override double duration
Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace UTJ.Alembic
{
public class AlembicShotPlayable : ScriptPlayable
public class AlembicShotPlayable : PlayableBehaviour
{
public AlembicStreamPlayer streamPlayer { get; set; }

Expand All @@ -16,9 +16,9 @@ public class AlembicShotPlayable : ScriptPlayable
public float m_TimeScale;
public AlembicPlaybackSettings.CycleType m_Cycle = AlembicPlaybackSettings.CycleType.Hold;

public override void ProcessFrame(FrameData info, object playerData)
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
base.ProcessFrame(info, playerData);
base.ProcessFrame(playable, info, playerData);

if (streamPlayer == null)
return;
Expand All @@ -28,7 +28,7 @@ public override void ProcessFrame(FrameData info, object playerData)
streamPlayer.m_PlaybackSettings.m_timeOffset = (float)m_StartTimeOffset;
streamPlayer.m_PlaybackSettings.m_endTime = (float)streamPlayer.m_PlaybackSettings.m_duration - m_EndTimeClipOff;
streamPlayer.m_PlaybackSettings.m_timeScale = (float)m_TimeScale;
streamPlayer.m_PlaybackSettings.m_Time = (float)handle.time;
streamPlayer.m_PlaybackSettings.m_Time = (float)playable.GetTime();
streamPlayer.m_PlaybackSettings.m_OverrideTime = true;
streamPlayer.m_PlaybackSettings.m_preserveStartTime = true;
}
Expand Down
2 changes: 1 addition & 1 deletion AlembicImporter/ProjectSettings/ProjectVersion.txt
@@ -1 +1 @@
m_EditorVersion: 5.6.0f3
m_EditorVersion: 2017.1.0b3

0 comments on commit 026d211

Please sign in to comment.