# Panda3D/Manual/FAQ

Contents
Q: What is the .pz files I am seeing the samples? A: Those are zipped files that are zipped with panda pzip/punzip command line tools tools that panda3d knows how to read
Usage:
Usage:
Q: What is the .pyc files i that are created every where? A: .pyc and .pyo are python compiled and python optimized compiled files
As an important speed-up of the start-up time for short programs that use a lot of standard modules, if a file called "spam.pyc" exists in the directory where "spam.py" is found, this is assumed to contain an already-``byte-compiled version of the module spam. The modification time of the version of "spam.py" used to create "spam.pyc" is recorded in "spam.pyc", and the file is ignored if these don't match. http://www.python.org/doc/1.5.1p1/tut/node43.html Q: I have a bunch of Maya Animations of one model in different mb files. I used maya2egg to port them into panda, but only one of the animations work. A: The key is to use the -cn <character's name> flag in maya2egg for every file. This ensures that the files work together.
Let's say you are making an animated dog. You have the following animations:
To convert these into panda, you would call
Note, we can grab the model from any of the animations, as long as they are all using the exact same rig:
Q: I'm using the lookAt function on a nodepath to point it at another object. It works fine until I point upwards, and then it starts to spin my object around randomly A: lookAt works as long as you aren't telling it to look in the direction of its up vector. Luckily, you can specify the up vector as the second argument.
Q: I'm building a 3d game, and I have a huge world. When my world starts up, the program hangs for a few seconds the first time I look around. Is there any way to avoid this? A: It can take a while to prepare objects to be rendered.
Ideally, you don't want this to happen the first time you see an object. You can offload the wait time to the beginning by calling:
This will walk through the scene graph, starting at self.myWorld, and prepare each object for rendering.
Q: Is there a way to hide the mouse pointer so that it doesn't show up on my screen? A: You can change to properties of the panda window so that it doesn't show the cursor:
Q: If a model has an animation, is that animation necessarily represented by an additional .egg file? A: No. An .egg file can either be just geometry, just an animation, or a combination of the two.
It's often easiest, however, to create a separate egg for every animation and an egg that contains just the model/skeleton information.
Q: I have a model with an animation. When i try to play the animation I get this error:
A: This often happens when you are trying to load animations onto a model that wasn't exported to have animations.
There are two pieces to objects that have animations; their geometry and their skeleton. The geometry is what you see when you load a model, the skeleton is what controls the geometry in an animation. If only the geometry was used to make the egg file, you will have problems when you try to play animations. Look at the manual for more details about exporting models as eggs.
Q: I called setTexture('tex.jpg') and it didn't change or send an error. A: To override an existing texture, you need to specify a priority: setTexture('tex.jpg', 1).
The setTexture call includes an optional priority parameter, and if the priority is less than 1 the texture will not change.
Q: I get this error:
It happens at this line of code:
A: Sequences and Parallels are a way to combine intervals. You can't put anything inside them that isn't an interval. If you want this code to work you want something like:
This will start the execution of the function, but not wait for it to finish.
Q: Does panda use degrees or radians? A: Degrees. But see also the deg2Rad and rad2Deg functions.
P: Porque todos os meus objetos planos parecem estranhos quando iluminados? R: Planos geralmente não tem muitas vértices
Lighting is only calculated at the vertices, and then linearly interpolated between the vertices. If your vertices are very far apart, lighting can look very strange--for instance, a point light in the center of a large polygon might not show up at all (the light is far from all four vertices, even though it's very near the polygon's center).
Uma solução é criar um modelo com muitos polígonos para acompanhar a iluminação. Também ajuda fazer uma superficie plana ligeiramente curvada para melhorar sua aparência. Outra alternativa seria criar uma luz ambiente que apenas afete este objeto. Veja o manual para mais detalhes sobre vincular luz á objetos em sua cena.
P: Para suavizar minhas animações, eu usei a opção "interpolate-frames 1", mas por algum motivo isso não funciona. Porque?
R: A flag interpolate-frames é setada no PartBundle no momento que este é criado pela primeira vez, e então ela é >baked< no cache bam.
Por isso, mudanças realizadas posteriormente na variável interpolate-frames são nulas. Se você mudou a flag interpolate-frames, você também precisará limpar sua pasta modelcache.
Atualmente não é recomendado o uso de interpolate-frames; ele é uma configuração global. É melhor conseguir o mesmo efeito através de actor.setBlend(frameBlend = true ), que é uma configuração por ator ( e não é >baked< no cache de modelos )
P: Eu estou tentando redirecionar o output de comandos como "myNode.ls" para um arquivo, mas o método usual "python>>file, myNode.ls" não funciona, Qual é a alternativa? R: Você pode tentar:
Outra alternativa:
Se você não quiser usar a StringStream você pode fazer o seguinte:
Existe também um meio de especificar o arquivo a ser escrito no arquivo config.
P: Como nós criamos um nodo de uma string contendo fonte .egg? R: Use a classe EggData:
P: Como nós podemos saber que letra estava abaixo do cursor quando nós clicamos em um TextNode? R: Use a classe TextAssembler como a seguir: