So, I load a model using
character=Actor()
character.loadModel("foo.egg")
I then check what’s in the model with
print character.ls()
and get back
PandaNode character
Character __Actor_modelRoot
GeomNode (2 geoms: S:(TextureAttrib))
what I want, and expect is to get back things that I have in groups.
<Group> character {
<Dart> { 1 }
<Group> Dog_Smmoth_B_Collie {
<Model> { 1 }
<VertexPool> Dog_Smmoth_B_Collie.verts {
...
}
}
<Group> eye_R {
<VertexPool> eye_R.verts {
...
}
}
...
}
So, I’m hoping to get Dog_Smmoth_B_Collie as a node so that I can apply a texture to it (since there are two uv-maps and I need to control them separately.
rdb
May 17, 2009, 8:55am
2
For actors, you must explicitly flag nodes that shouldn’t be combined via egg-optchar. Search the forums about this.
ok, so I did this
egg-optchar -d outputDir -flag Dog_Smmoth_B_Collie=body -flag eye_R=eye_r -flag eye_L=eye_l -flag Dog_Smmoth_B_Collie.verts=b_verts smooth_collie2.egg"
and it gave me body, eye_r and eye_l but not b_verts.
I need to texture the body using the info from b_verts, but when I set the body to the texture it ignores the uv mapping in the verts.
(Does that even make sense?)
Anyways, I have a couple of UV_Maps and I need to apply the texture to only one part, I assume that if I got the body and applied the texture to only that it would use the uv map that was in group body, but this appears not to happen.
Any idea on what I’m doing wrong?
rdb
May 17, 2009, 9:37am
4
I think it must be a entry, not a entry. So try and wrap it into a .
Ok, so, what I was trying to do doesn’t help me do what I need to do. So here is a description of what I need to do with this.
I have an actor, the actor has several UV maps (2), I need to apply a texture to the body of those maps.
dogTexture = loader.loadTexture(os.path.join(settings.BASE_LOCATION, "panda_models/Graphic1.jpg"))
character.find("**/body").setTexture(dogTexture, 1)
The following does not use the UV map for some reason, and I don’t understand why.
Any ideas would be great, I think my whole approach is wrong at this point.
rdb
May 17, 2009, 6:31pm
6
Probably you need to find the texture stage first:
dogTexture = loader.loadTexture(os.path.join(settings.BASE_LOCATION, "panda_models/Graphic1.jpg"))
dogStage = character.find("**/body").findAllTextureStages()[0]
character.find("**/body").setTexture(dogStage, dogTexture, 1)
PS. Note that this might not work on Windows, since Panda requires unix paths, even on windows, so os.path.join might not work.