Weird error

I’m debugging a program. But I’m getting this weird error:

AssertionError: _error_type == ET_ok && other._error_type == ET_ok at line 707 of panda/src/pgraph/nodePath.cxx

I have a simple collision detection running with certain collisions resulting in the removal of the colliding nodes. But as far as I can tell I’ve corrected for the removal of the node.

Anyone have any idea what this means?

Could you please post the part of the code where this error occurs, so we can track this problem.

I think I’ve gotten around the error, but here’s the code that produced it

if self.target is not None:
			try: self.pointer.lookAt(self.target)

It’s weird I thought I had enough fail safes on it already.

looks like self.pointer is None? :slight_smile:

Either self.pointer or self.target is an empty NodePath. This is typically returned from a nodePath.find() operation that did not successfully find a node. Node that nodePath.find() never returns None; if it fails, it will return an empty NodePath to indicate this. You can test for an empty NodePath by using nodePath.isEmpty().

David

Thanks,

This helps a lot. I spent a lot of time trying to figure a work around. self.pointer is diffenately still around, the problem is that in a different part of the code the self.target was killed (it’s part of a game).

I thought the dead node

NodePath.detachNode()[

would be a NoneType. But it’s not. This command

NodePath.isEmpty()

should help out.

For the moment, I’m stashing the node instead of detaching it- works fine. Is there any advantage to detaching the node and using this isEmpty() command over stashing?

nodePath.detach() removes a node from the scene graph, but doesn’t make the NodePath empty–the NodePath still has a pointer to the valid node.

You must be confusing the above call with nodePath.removeNode(), which removes the node from the scene graph, and also makes the NodePath empty. Note there is no method called detachNode().

Both of these are different from nodePath.stash(), which temporarily moves the node to a hidden part of the scene graph, so that it may later be restored with a call to unstash().

Each of these is appropriate in different circumstances. I don’t know exactly what your circumstances are, but if your intention is to remove the node and never bring it back, removeNode() is probably the most appropriate call.

David