Panda3D Manual: Panda3D Utility FunctionsPanda3D has a set of utilities that may be used to learn more about various objects and methods within an application. To access these utilities you need to import the PythonUtil module as follows. from direct.showbase.PythonUtil import * The To get a detailed listing of a class or an object's attributes and methods, use the pdir() command. pdir() prints the information out to the command console. pdir() can take many arguments for formatting the output but the easiest way to use it is to provide it a NodePath. pdir() will list all of the functions of the class of NodePath including those of its base classes pdir(NodePath) e.g. pdir(camera) There are many other useful functions in the PythonUtil module. All of these are not necessarily Panda specific, but utility functions for python. There are random number generators, random number generator in a gaussian distribution curve, quadratic equation solver, various list functions, useful angle functions etc. A full list can be found in the API. An alternative command to from direct.tkpanels.inspector import inspect inspect(NodePath) E.g. inspect(camera) While the directtools suite calls upon a number of tools, if the suite is disabled, the user may activate certain panels of the suite. The camera.place() render.explore() panda.rgbPanel() Useful DirectTool panels are explained in the Panda Tools section. © Carnegie Mellon University 2010 |