OGRE EXCEPTION(3:RenderingAPIException):


02-01-2011 10:10:39

05:01:37: Can't assign material Material to SubEntity of drone because this Material does not exist. Have you forgotten to define it in a .material script?
05:03:49: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at ..\..\..\ogre\RenderSystems\Direct3D9\src\OgreD3D9RenderSystem.cpp (line 2823)

it happens after updating a loaded MeshPtr and SkeletonPtr, and renderoneframe is called. here is my main loop:
#region Primary Loop
while (!OgreWindow.Instance.ShuttingDown)
if (object.Equals(null, OgreWindow.Instance.mRoot)) break;
b = true;
loops = 0;
while (DateTime.Now.Ticks > next_game_tick && loops < MAX_FRAMESKIP)
next_game_tick += SKIP_TICKS;
interpolation = (float)(DateTime.Now.Ticks + SKIP_TICKS - next_game_tick) / (float)(SKIP_TICKS);
ExtraMegaBlob.References.Math.clamp_hi(1f, ref interpolation);
if (!OgreWindow.Instance.pauserendering)
OgreWindow.Instance.renderingframe = true;
b = OgreWindow.Instance.mRoot.RenderOneFrame();
OgreWindow.Instance.renderingframe = false;
if (!b) break;

does anyone know what could be causing this?