Model

Hello all! So I’ve been using panda3d for about half a year now and I’ve learned a lot. well recently I’ve gotten into modeling so I decided to use it to my advantage. so I got blender and made this gyazo.com/8af59ce0d4f10730590b7385cc5b7bba through this code

self.modelloader("TREE", "Client/etctest/TREE.bam", render, 0.4, 115, 0.3, -90, 0, 0, 3, 3, 3)

I don’t really know if there is a way to get around this without textures, because I love the way it looked with the material and lamp. but is there perhaps a way I can get the lamp lighting and material into my game without having to texture? Is there a good method to code this? I’ve been using panda3d for 6 months, but have not been extremely active, so I don’t really know too much. Any advice is appreciated. I’d love to be able to make models like this and use them in a game with panda3d.

I think you are looking for ‘baking’ the lighting into the texture. Normally its used to bake ambient occlusion, but I think you can bake all the lights you need.

Heres a few links to get started:
cgcookie.com/blender/2010/07/06/ … occlusion/
katsbits.com/tutorials/blend … lusion.php

Rather then selecting ambient occlusion in the bake area full render might work?

Thank you so much! A secondary problem has arisen. I got the model in and everything and I noticed collisions aren’t working. I learned that you could do collisions right into panda :slight_smile: so I checked out a tutorial and found some helpful information, but when I imported this code

        base.cTrav=CollisionTraverser()
        collisionHandler = CollisionHandlerQueue()

        treeModel = loader.loadModel('Client/etctest/TREE.bam')
        treeModel.reparentTo(render)
        treeModel.setPos(0.4, 115, 0.3)

        treeCollider = treeModel.find("**/Cone")
        base.cTrav.addCollider(treeCollider, collisionHandler)

I got Assertion Error: !collider.is_empty()

It seems likely that the “find” method is failing to find an object named “Cone” in your model–are you sure that it’s there, and that you have the name correct?

(It might help to call “treeModel.ls()”, then examine the output produced, in order to check that “Cone” is in fact present.)

ran treeModel.ls() and sure enough its there gyazo.com/8ded31bb51ccc69a70abdcf5005279e5

EDIT: I added this " object { polyset keep descend }" to the .egg and then converted it into .bam and it worked instead of coding it. however, its really buggy. If I keep holding the forward button I can eventually pass through the model, and sometimes I’m able to walk straight over models with collisions, such as walk straight up a tree, but I might just have to add collisions to the leaves to prevent that.