I am working on issue 1047 and have got a test case working that shows the bug. I am in the process of tracking down where in the code the bug occurs. However, I have hit a roadblock in that I am unable to find the function loadSync in the code.
It is used at line 288 in Loader.py to load a model. What I normally have done to continue to trace through code is one of the following
Step into it using the debugger (Doesn’t work, just steps over it)
Use the functions of the IDE I am using to find it
As a last resort, do a general search
None of these are turning up the function. My guess is that it is jumping into the C++ code at that point, but I can’t find it. Any ideas appreciated.
In general, the search functionality of the manual/API seems to be pretty effective. A quick search for “loadSync” quite quickly turned up its presence in the “Loader” class.
So if you’re struggling to find a function or method, I’d suggest turning to the manual’s search bar!
Thanks Taumaturge. That gives me the Loader.py class, but there is no LoadSync there. serega-kkz load_model got me on the right track. However, how does LoadSync in python lead you to load_model in C++?
In general, and if I’m not much mistaken, Panda’s methods and functions are created in snake-case first, and camel-case as a convenience after. (And possibly for Python only; I’m not sure.) In some cases, the API may not show the camel-case versions. (Or only shows them in the Python API, as is the case here.)
Thus, if you don’t find the camel-case version, it’s worth looking for the presence of the snake-case version.
Note that the search function seems to direct you to the right module anyway–you may just have to manually search within the resultant page.
Methods in the C++ code are defined as load_sync(), and camelCase aliases are automatically generated for compatibility reasons. So if you are searching the source code (which is the best way to find something; I use ripgrep myself)
Loader.py and the C++ Loader class are two distinct things. The former uses the latter under the hood. The latter is defined in panda/src/pgraph/loader.{h,cxx,I} and is what contains load_sync().