I’m working on a Panda3D project using Toontown’s models (for personnal use). I created a “Mingler”, and I want to change her/his textures. here’s my code :
Traceback (most recent call last):
File "main.py", line 154, in <module>
gamebase.run()
File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 2921, in run
self.taskMgr.run()
File "C:\Panda3D-1.8.1\direct\task\Task.py", line 502, in run
self.step()
File "C:\Panda3D-1.8.1\direct\task\Task.py", line 460, in step
self.mgr.poll()
File "*****\etc.py", lin
e 96, in _goTask
self.target(tp = self)
File "*****\tutorial.py"
, line 41, in __init__
self.mingler.find("**/sleeve").setTexture(loader.loadTexture("data/models/cag/s_sleeve.jpg"), 1)
AssertionError: !is_empty() at line 3507 of panda/src/pgraph/nodePath.cxx
I usually get the !is_empty assertion when I’m doing a find but it can’t find that part of the model. Are you sure there is a part called ‘sleeve’ on your model?
If it gives the !is_empty() error, then find("**/something") returned an empty NodePath, which means that it didn’t find anything.
You can call self.mingler.ls() to show the structure of the model on the command-line, which you can then use to find the proper name of the parts to pass to the find() call.
It could also be that self.mingler itself is an empty NodePath, which means that it perhaps wasn’t loaded successfully (eg if you assign it using self.mingler = loader.loadModel(…)). Are there any other error messages on the command-line?