internal void UnsafeReInit(CRenderContext rc, NativePointer self) { Core_Release(); mCoreObject = self; Core_AddRef(); for (UInt32 i = 0; i < MdfNumber; i++) { var mdfPtr = SDK_GfxMdfQueue_GetModifier(CoreObject, i); var mdfName = CGfxModifier.SDK_GfxModifier_GetName(mdfPtr); var mdfType = Rtti.RttiHelper.GetTypeFromSaveString(mdfName); //这里好像最好不要克隆,因为我们希望这种调用是CGfxMeshPrimitives加载的时候用,他就是表征vms, //而不是自己独立一份的数据 //var mdfPtr = CGfxModifier.SDK_GfxModifier_CloneModifier(mdfPtr, rc.CoreObject); if (mdfPtr.GetPointer() == IntPtr.Zero) { continue; } var modifier = System.Activator.CreateInstance(mdfType, new object[] { mdfPtr }) as CGfxModifier; if (modifier == null) { continue; } AddModifier(modifier); } UpdateHash64(); }
public void AddModifier(CGfxModifier modifier) { Modifiers.Add(modifier); SDK_GfxMdfQueue_AddModifier(CoreObject, modifier.CoreObject); UpdateHash64(); HostMesh?.MdfQueueChanged(); }