I have a little question :
how to see the ModelPath of a 3D model already loaded in panda ?
for exemple, i know how to have the current position of a model (getPos), but not the ModelPath (loader.loadModel)
Someone have an idea ?
thanks in advance
Not sure what you mean. You mean the filename it was loaded from? Try:
for exemple, if i load this
self.ralph = loader.loadModel ("models/ralph.egg")
i want to print
print self.ralph.getFullpath ()
and this must be in the screen
but it say me an error
I already tried it, but it’s not work :s
same problem with “getModelPath ()”.
here is what it say when i tape .getFullpath ()
AttributeError : 'libpanda.NodePath' object has no attribute 'getFullpath'
any idea ?
thanks in advance.
Yep. You have been lazy when “taping”. It’s not np.getFullpath() but np.node().getFullpath().
loader.loadModel() returns a NodePath instance (or None if the path has been wrong). The class NodePath does not have a method getFullpath. Only the class ModelRoot has such a method. And you get the model root node from the node path by using np.node().
More information is provided in the API documentation (above on this page, in the green bar, where Documentation is listed).
ha yes, it’s work right now
thank you very much