has_mat() error

when i use shadow function:
render…setShaderAuto()
light.setShadowCaster(True, 512, 512)
( with setting loadPrcFileData(’’, ‘hardware-animated-vertices true’) )

AssertionError: has_mat() at line 461 of e:\mywork\panda3d1.9\built\include\transformState.I