Loading Models ETC

I have having trouble loading models and scenerys into the editor.
I have tried to load things and It is saying file not found even when the file is in exact location. I am in need of help of fixing this and can someone send me the code to actually load a map so I can test it out. For example if I had a building to walk in how would i load that. TY for helps.

EDIT: It says attribute error. What does this mean.

Here is what I would figure out to do. Please help me and tell me what
I did wrong.

All I am trying to do is make the box and make it appear so I can look at it.
import direct.directbase.DirectStart

Box = loader.loadModel(‘model/object’)
Box.reparentTo(render)

run()

Hmm, here are some thoughts that come to mind.

  1. Panda is case-sensitive by default. So make sure that you are using the correct case. E.g. if the filename is actually Object.egg, not object.egg, you have to load it with loadModel(‘model/Object.egg’)

  2. It helps to be explicit with filename extensions too. If you’re loading an egg file, say so: loadModel(‘model/object.egg’)

  3. You’re loading a file from a relative path. Are you sure of the directory you’re starting from? Make sure that you’ve got “.” on the model-path search list, which stands for the current directory (if that isn’t there, it won’t find it). You can put it there by putting:

model-path .

in your Config.prc file. In the meantime, you can prove that this is or isn’t the problem by using a full path, that starts with a slash and a drive letter, something like: loadModel(’/c/myFolder/myOtherFolder/myStuff/model/object.egg’).

  1. If you show us the exact output of your program, including all error messages, it might give us some more clues.

David

import direct.directbase.DirectStart
from direct.task import Task
from direct.actor import Actor

Box = loader.loadModel(’/c/Panda3D-1.5.2/models/object.egg’)
Box.reparentTo(render)

run()

That is my new code wich does work but the box (model) does not show up.
The big grey application box still shows up.
I do not know why this doesnt work since that is what I am told to do.
I do not have any errors when I run this and the only thing wrong with it is it does not show up. Any help?

Your box is probably around the camera, so you don’t see it. How big is it? Put it somewhere in front of the camera, like this:

Box.setPos(0, 100, 0)

David

import direct.directbase.DirectStart

Box = loader.loadModel(’/c/Panda3D-1.5.2/models/object.egg’) ;
Box.setPos(2, 100, 2) ;
Box.reparentTo(render);
run()

The model is still not showing up but everything else is still working(gray box still comes up ).
I changed the 0’s to 2’s just for test purposes.
Gotta go to school bbl

Oh, you’re loading the standard box.egg that comes with Panda, of course. That’s 1 x 1 x 1, so maybe I had you put it too far away–it would be tiny at 100 units away.

Try:

Box.setPos(-0.5, 5, -0.5)

David

I did that and no It is not the same model, it is different. I loaded model object.egg wich is a box so I named it box loool.

I did that and it still did not show up. I do not know whats wrong anymore since you dont find anything wrong with it other then pos. Maybe he did not give me a accurate model or maybe it is possibly grey. How are textures loaded in?(If that is the case lmfao)

I have to go to school so ILl talk later.

Well, what does your model look like? Have you tried to view it in pview?

pview models/object.egg

If you don’t see the model right away, press ‘c’ to center the view on the model.

Also, try loading box.egg instead, just to prove that you’re on the same page with a model that you know works.

David

It must be the model cuz that worked lmfao. I think jeff might feel bad when he hears about this one xD.

What do you think is wrong with his.

Open up the egg file in Notepad or some text editor. Make sure it has entries and entries.

David

FOR4 ÄMayaFOR4 €HEADVERS 2008UVER undef MADE undef CHNG Wed, Sep 03, 2008 05:51:34 AM ICON undef INFO undef OBJN undef INCL undef( LUNI cm TUNI filmAUNI deg FINF application maya FINF product Maya Unlimited 2008 FINF
version 2008 FINF "cutIdentifier 200708022245-704165 FINF 7osv Microsoft Windows XP Service Pack 3 (Build 2600)\n FOR4 8XFRMCREA pCube1 DBL3 et @¸!kKt@Šî à M@¾éh¸7FOR4 DDMSHCREA pCubeShape1 pCube1 ATTR KaBOL N miShadingSamplesOverride mso ?ð DBLE ATTR KaFLTN miShadingSamples msh @( @ DBLE ATTR HaBOL N miMaxDisplaceOverride mdo ?ð DBLE ATTR @aFLTJ miMaxDisplace mmd ?ð DBLE FLGS v DBLE vir ?ð DBLE vif ?ð STR uvst[0].uvsn $map1 STR cuvs map1 STR dcc Ambient+Diffuse CMPD !covm[0] ?ð ?ð CMPD !cdvm[0] ?ð ?ð FOR4 lPCUBCREA polyCube1 DBLE w $@eâiá)´ DBLE h $@Šî à M DBLE d $@âñs†à è DBLE cuv 0@ FOR4 DRLLKCREA lightLinker1 FLGS lnk ( FLGS slnk ( FOR4 $SLCTSLCT :time1 DBLE ao ú FOR4 ,SLCTSLCT :renderPartitionFLGS st FOR4 SLCTSLCT :renderGlobalsList1 FOR4 0SLCTSLCT :defaultShaderList1 FLGS as ( FOR4 0SLCTSLCT :postProcessList1 FLGS ap ( FOR4 SLCTSLCT :lightList1 FOR4 4SLCTSLCT :initialShadingGroupDBLE ro ?ð FOR4 4SLCTSLCT :initialParticleSE DBLE ro ?ð FOR4 TSLCTSLCT :hardwareRenderGlobals DBLE ctrs $@p DBLE btrs $@€ FOR4SLCTSLCT :defaultHardwareRenderGlobals STR afn im STR eres ntsc_4d 646 485 1.333 LIS4 hCONSFOR4 \CONNCWFL polyCube1.out pCubeShape1.i CWFL / :defaultLightSet.msg lightLinker1.lnk[0].llnk CWFL 3 :initialShadingGroup.msg lightLinker1.lnk[0].olnk CWFL / :defaultLightSet.msg lightLinker1.lnk[1].llnk CWFL 1 :initialParticleSE.msg lightLinker1.lnk[1].olnk

That is what is in there I am pretyt sure it does not have it in there.
Also plesae help me figure out how to apply textures.

Sorry for asking all the help. I will also search forit.

That’s not an egg file. That looks like a Maya file. See the instructions in the Manual for converting Maya files to egg files.

David

lol ty