public DescID(DescLevel id1, DescLevel id2, DescLevel id3) : this(C4dApiPINVOKE.new_DescID__SWIG_5(DescLevel.getCPtr(id1), DescLevel.getCPtr(id2), DescLevel.getCPtr(id3)), true) { if (C4dApiPINVOKE.SWIGPendingException.Pending) { throw C4dApiPINVOKE.SWIGPendingException.Retrieve(); } }
public void PushId(DescLevel subid) { C4dApiPINVOKE.DescID_PushId(swigCPtr, DescLevel.getCPtr(subid)); if (C4dApiPINVOKE.SWIGPendingException.Pending) { throw C4dApiPINVOKE.SWIGPendingException.Retrieve(); } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DescLevel obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
private bool SaveTracks(BaseObject ob, SceneNodeContainer snc, bool slerpRotation) { var builder = new TrackBuilder(); builder.LerpType = (slerpRotation) ? LerpType.Slerp : LerpType.Lerp; CTrack track = ob.GetFirstCTrack(); // First occurence of animation tracks? if (track == null) { return(false); } while (track != null) { DescID testID = track.GetDescriptionID(); DescLevel lv1 = testID.GetAt(0); DescLevel lv2 = testID.GetAt(1); CCurve curve = track.GetCurve(); if (curve != null) { int keyCount = curve.GetKeyCount(); CKey key = null; BaseTime time; for (int i = 0; i < keyCount; i++) { key = curve.GetKey(i); time = key.GetTime(); switch (lv1.id) { case 903: // should be replaced with "ID_BASEOBJECT_REL_POSITION" switch (lv2.id) { case 1000: builder.AddTranslationValue("x", (float)time.Get(), key.GetValue()); break; case 1001: builder.AddTranslationValue("y", (float)time.Get(), key.GetValue()); break; case 1002: builder.AddTranslationValue("z", (float)time.Get(), key.GetValue()); break; } break; case 904: // should be replaced with "ID_BASEOBJECT_REL_ROTATION" switch (lv2.id) { case 1000: builder.AddRotationValue("x", (float)time.Get(), key.GetValue()); break; case 1001: builder.AddRotationValue("y", (float)time.Get(), key.GetValue()); break; case 1002: builder.AddRotationValue("z", (float)time.Get(), key.GetValue()); break; } break; case 905: // should be replaced with "ID_BASEOBJECT_REL_SCALE" switch (lv2.id) { case 1000: builder.AddScaleValue("x", (float)time.Get(), key.GetValue()); break; case 1001: builder.AddScaleValue("y", (float)time.Get(), key.GetValue()); break; case 1002: builder.AddScaleValue("z", (float)time.Get(), key.GetValue()); break; } break; } } } track = track.GetNext(); } builder.BuildTracks(snc, _tracks); if (_animationsPresent) { return(false); } return(true); }
public DescLevel GetAt(int pos) { DescLevel ret = new DescLevel(C4dApiPINVOKE.DescID_GetAt(swigCPtr, pos), false); return(ret); }