upcastToPandaNode(), what is the purpose ?

I’ve tried the following two lines, one with upcastToPandaNode(), and the other one without it.

ambientLightNP = render.attachNewNode( ambientLight.upcastToPandaNode() )

ambientLightNP = render.attachNewNode( ambientLight )

I can’t find any difference in the end results. In the manual, it does not mention the purpose of this function. Can you explain how to use this function?

I believe upcastToPandaNode is the old way to do it, Panda can now automatically cast a LightNode to a PandaNode if you pass it to attachNewNode. upcastToPandaNode is just still there for backwards compatibility, I believe.

Yes. Any reference you find to upcastToPandaNode() is outdated. There is no reason to ever call this method.


is there a way to phase out really old methods?

Thank you for the reply. Documentation is always an issue for every project ! Fortunately you guys give very quick replies in these forum.

These things are surprisingly persistent. I generally put warning messages within these methods to be displayed when they are called (like loadModelCopy() and so on). But in the case of upcastToPandaNode(), this method is still used (and required) internally so I can’t put a warning message within it. I guess we could rename the method to something else, maybe.