strange issue loading models

I am loading models with this method.

def loadModels(rootNode = None, terrain = None):
	if((rootNode != None) and (terrain != None)):
		loadModel(rootNode, terrain, "assets/models/RangeTower01", Vec3(7798.960, 533.1967, 0), VBase3(0,0,0), 1.0)
		loadModel(rootNode, terrain, "assets/models/tree01_ash", Vec3(9139.362, 178.495, 0), VBase3(-66,0,0), 1.0)
		loadModel(rootNode, terrain, "assets/models/tree02_ash", Vec3(9125.202, 287.376, 0), VBase3(10,0,0), 1.0)
		loadModel(rootNode, terrain, "assets/models/tree03_ash", Vec3(8461.250, 350.621, 0), VBase3(30,0,0), 1.0)
		loadModel(rootNode, terrain, "assets/models/tree_ash_group", Vec3(7950.076, 260.014, 0), VBase3(26,0,0), 1.0)

On one computer, this loads fine, on my laptop it asserts with this error:

Assertion failed: !(pos.is_nan() || quat.is_nan() || scale.is_nan() || shear.is_nan()) at line 259 of c:\p\p3d\panda3d-1.6.2\panda\src\pgraph\transformState.cxx
Assertion failed: has_mat() at line 585 of c:\p\p3d\panda3d-1.6.2\built\include\transformState.I
Assertion failed: has_mat() at line 585 of c:\p\p3d\panda3d-1.6.2\built\include\transformState.I
Traceback (most recent call last):
  File "C:\Panda3D-1.6.2\direct\showbase\ShowBase.py", line 1568, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: !(pos.is_nan() || quat.is_nan() || scale.is_nan() || shear.is_nan()) at line 259 of c:\p\p3d\panda3d-1.6.2\panda\src\pgraph\transformState.cxx
:task(error): Exception occurred in PythonTask igLoop
Traceback (most recent call last):
  File "demomaster.py", line 54, in <module>
    run()
  File "C:\Panda3D-1.6.2\direct\showbase\ShowBase.py", line 2423, in run
    self.taskMgr.run()
  File "C:\Panda3D-1.6.2\direct\task\TaskNew.py", line 471, in run
    self.step()
  File "C:\Panda3D-1.6.2\direct\task\TaskNew.py", line 429, in step
    self.mgr.poll()
  File "C:\Panda3D-1.6.2\direct\showbase\ShowBase.py", line 1568, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: !(pos.is_nan() || quat.is_nan() || scale.is_nan() || shear.is_nan()) at line 259 of c:\p\p3d\panda3d-1.6.2\panda\src\pgraph\transformState.cxx

I can comment out the load of the tree_ash_group and tree03_ash, and the rest will load. Or I can load the tree03_ash by itself, but anything else crashes. I would think its code, but it runs perfectly fine on one PC, and not another, so I am thinking its a hardware issue of some sort.

Any ideas?

It’s complaining that there’s garbage value in a transform on your scene graph. This usually means a floating pointer or some such; it’s probably a code error of some kind. Just because it doesn’t happen on every machine doesn’t mean it’s not a code error; with a floating pointer error, you end up with unpredictable behavior, which may consistently work on one machine and consistently fail on another machine, for no obvious reason.

Then again, it might be something else. Hard to know for sure.

What does your loadModel() method look like?

David

def loadModel(parentNode, terrain, path, position, rotation, scale):
	m = loader.loadModel(path)
	m.setPos(position)
	elevation = terrain.getElevation(position.getX() / Globals.terrainXScale, position.getY() / Globals.terrainYScale)
	#print elevation
	#print Vec3(position.getX(), elevation * Globals.terrainZScale, position.getY())
	m.setZ(elevation * Globals.terrainZScale)
	m.setHpr(rotation)
	m.setScale(scale)
	#m.setShaderAuto()
	m.reparentTo(parentNode)

I recently commented out all the setShaderAuto() calls because panda keeps trying to rebuild the shaders every frame. But I did a days worth of testing without any issues afterward…
[/code]

Certainly seems innocent enough. It might be a bug deeper in Panda. Do you mean to say that it crashes only when setShaderAuto() is enabled, or does it crash regardless of this setting?

David

its regardless of this setting, I disabled it because of another error somewhere else that is causing the shaders to be rebuilt every frame… it was dropping my framerate to nearly nothing.

It doesn’t have any effect one way or another tho…
I’ll start eliminating chunks of code until I can narrow the issue down, if you don’t believe the error is in the actual loading of the models, or I can wrap up my project to have you take a look (I can’t seem to get the c++ debug running, or I would debug it myself)