Rdb's patch https://www.panda3d.org/forums/viewtopic.php?p=97458#p97458
Merge