Model invisible in pview and in-game (solved)

That’s the output of sword.ls()… It’s definitely there, and even has it’s collision recognized.

The code calling it to exist is thus:

#load sword in air
sword=loader.loadModel("crapsword.egg")
sword.reparentTo(environ)
sword.setScale(2,2,2)
sword.setPos(0,0,20)
sword.ls()

I’m building my game from the panda example onward, at least for testing various chunks of code, and so I tried parenting the sword to the pandaActor, environ, and render, none of which had it show up. I tried making it .2x size, 2x size, normal, and nothing shows up. The ls has output, so it’s being loaded… I’m rather confused. Does the (hidden) in the ls mean that the model is hidden in some way, or that the collision object is hidden? has no idea what’s going on

Thanks,
~EyesOfARaven

Edit: btw, I’m using Maya 2008 (which I’m learning alongside Panda while devving the game), and the exporter works fine…

It says (hidden). Are you sure the file contains more than just solids? Can you maybe post the .egg file here?

mediafire.com/?myhwvhvmymi

That link is to the egg file… It’s just a ruddy sword I made in Maya, first model ever.

CollisionNodes are hidden by default, because they’re not intended to be seen.

There are no GeomNodes in your model, so there’s nothing there that’s visible.

The { barrier } line means to create invisible collision polygons instead of the normal visible geometry.

David

I want my weapon to have collision that is (preferably) limited to the model itself, in order to implement realistic physics for when the weapon is dropped, or used in combat, which will all come later. What should I use? If that isn’t possible, what is the standard collision for something like that - a sphere? I’ll just have to program my own system if there isn’t something built in…

Edit: Getting rid of the attribute entirely solved the problem.

To clarify for future ppl’s knowledge, collision objects and normal objects should apparently be separate models.

Does removing these tags do any good:

<Scalar> visibility { hidden }
}
} 

Was what I edited my post to a valid assessment? Or can I indeed have collidable visible objects? :stuck_out_tongue:

if you want your dropped weapon to collide with the floor or other things you would have to use a collision solid. triangle vs triangle collision is not supported or doesnt really work well with pandas internal collision detection.
if you’r going to use the integrated ODE version this might be different.
but for pandas internal collision you would have to use sphers or tubes. box solids are on the to-do. but no idea when they will be available.

I’ve got my model to show in pview, but not in game. Just in case I was calling it wrong in some way I replaced the pandaActor’s model with it and it still didn’t show up…?

Here’s the code that displays it, it’s parented to the panda atm so that I’ll know where to look for it (floating above the panda, no?)…

#load sword in air
sword=loader.loadModel("crapsword.egg")
sword.reparentTo(pandaActor)
sword.setScale(2,2,2)
sword.setPos(0,0,20)
sword.ls()

I also tried removing those visibility lines that were mentioned above, no go…

I should note that the egg file still contains no "GeomNode"s that I can find, I ctrl+F’d for “geom”, nada…

New LS:

I got it to work! I had a hunch that it might just be so small I can’t see it, so I made it scale to 100 and it dwarfed the panda, and was indeed there.

Thanks for your time guys, and if there is a more comprehensive tutorial on collision than that in the manual, could you please direct me to it? (or any other things you think i may find useful, really!)

If you use mayapandatool to export your scene, you have to sync the scale yourself.
Use mine to ensure 1:1 scale :
discourse.panda3d.org/viewtopic.php?t=2503