Bones - Skeletal and Pose Animations for jPCT/jPCT-AE > Bones

How to set texture to object material

(1/3) > >>

jaychang0917:
Suppose my model is a composite of objects, and each object contains few materials, I need to map different texture for each material.

I tried to print the name, i can't get the material name but object name. How can I get the material name of each object?

--- Code: ---for (Animated3D o : skinnedGroup) {
    System.out.println("name:" + o.getName());
    o.build();
    o.discardMeshData();
}
// output
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:headMesh_triangles
name:Cover_LMesh_triangles
name:Cover_LMesh_triangles
name:Cover_RMesh_triangles
...

--- End code ---


raft:
you cannot I believe. materials and texture information is not passed to Bones during export-import process. texture coordinates are passed though.

in this case, you can for example bake the materials into a texture and assign that texture to your Animated3D's

raft:
video not appearing part may also related to a thread synchronization issue. in particular if you dont consume a video frame new update never arrives (as far as I remember)

jaychang0917:

--- Quote from: raft on April 05, 2017, 11:13:12 pm ---you cannot I believe. materials and texture information is not passed to Bones during export-import process. texture coordinates are passed though.

in this case, you can for example bake the materials into a texture and assign that texture to your Animated3D's

--- End quote ---

i tried to set the texture by Animated3D index instead of name, seems work.

--- Code: ---animatedGroup.get(0).setTexture("head");
animatedGroup.get(1).setTexture("headTop");
animatedGroup.get(2).setTexture("head");
...

--- End code ---

jaychang0917:

--- Quote from: raft on April 06, 2017, 02:59:45 pm ---video not appearing part may also related to a thread synchronization issue. in particular if you dont consume a video frame new update never arrives (as far as I remember)

--- End quote ---

?? you are answering my qestion? :)

Navigation

[0] Message Index

[#] Next page

Go to full version