Skip to content

Commit

Permalink
revived some ugly code for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
i-saint committed Jan 31, 2018
1 parent eadbfad commit 37cefd0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion AlembicImporter/Assets/Packaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void MakePackage_Alembic()
{
string[] files = new string[]
{
"Assets/UTJ",
"Assets/UTJ/Alembic",
};
AssetDatabase.ExportPackage(files, "AlembicForUnity.unitypackage", ExportPackageOptions.Recurse);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public override void OnImportAsset(AssetImportContext ctx)
streamDescriptor.abcEndTime = abcEndTime = endTime = tr.endTime;

var streamPlayer = go.AddComponent<AlembicStreamPlayer>();
streamPlayer.m_streamDescriptor = streamDescriptor;
streamPlayer.streamDescriptor = streamDescriptor;
streamPlayer.m_startTime = startTime;
streamPlayer.m_endTime = endTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ public class AlembicStreamPlayerEditor : Editor
public override void OnInspectorGUI()
{
SerializedProperty vertexMotionScale = serializedObject.FindProperty("m_vertexMotionScale");
SerializedProperty streamDescriptorObj = serializedObject.FindProperty("m_streamDescriptor");
SerializedProperty streamDescriptorObj = serializedObject.FindProperty("streamDescriptor");
SerializedProperty currentTime = serializedObject.FindProperty("m_currentTime");
SerializedProperty startTime = serializedObject.FindProperty("m_startTime");
SerializedProperty endTime = serializedObject.FindProperty("m_endTime");
SerializedProperty asyncLoad = serializedObject.FindProperty("m_asyncLoad");

var streamPlayer = target as AlembicStreamPlayer;
var targetStreamDesc = streamPlayer.m_streamDescriptor;
var targetStreamDesc = streamPlayer.streamDescriptor;
var multipleTimeRanges = false;
foreach (AlembicStreamPlayer player in targets)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace UTJ.Alembic
public class AlembicStreamPlayer : MonoBehaviour
{
public AlembicStream m_stream;
public AlembicStreamDescriptor m_streamDescriptor;
public AlembicStreamDescriptor streamDescriptor;
[SerializeField] public double m_currentTime;
[SerializeField] public double m_startTime = double.MinValue;
[SerializeField] public double m_endTime = double.MaxValue;
Expand All @@ -20,16 +20,16 @@ public class AlembicStreamPlayer : MonoBehaviour

void OnValidate()
{
if (m_streamDescriptor == null) return;
m_startTime = Mathf.Clamp((float)m_startTime, (float)m_streamDescriptor.abcStartTime, (float)m_streamDescriptor.abcEndTime);
m_endTime = Mathf.Clamp((float)m_endTime, (float)m_startTime, (float)m_streamDescriptor.abcEndTime);
if (streamDescriptor == null) return;
m_startTime = Mathf.Clamp((float)m_startTime, (float)streamDescriptor.abcStartTime, (float)streamDescriptor.abcEndTime);
m_endTime = Mathf.Clamp((float)m_endTime, (float)m_startTime, (float)streamDescriptor.abcEndTime);
ClampTime();
m_forceUpdate = true;
}

void Update()
{
if (m_stream == null || m_streamDescriptor == null)
if (m_stream == null || streamDescriptor == null)
return;

ClampTime();
Expand Down Expand Up @@ -67,9 +67,9 @@ private void ClampTime()

public void LoadStream()
{
if (m_streamDescriptor == null)
if (streamDescriptor == null)
return;
m_stream = new AlembicStream(gameObject, m_streamDescriptor);
m_stream = new AlembicStream(gameObject, streamDescriptor);
m_stream.AbcLoad();
m_forceUpdate = true;
}
Expand Down

0 comments on commit 37cefd0

Please sign in to comment.