leon.dong Posted June 7 Share Posted June 7 (edited) From the sample code , we can assign a texture to material then apply to mesh object. My Node info is : I want to assign a texture to material then apply on Static mesh . ObjectMeshStaticPtr mesh= ObjectMeshStatic::cast(myTempNode); if (mesh) { MaterialPtr material = mesh->getMaterialInherit(0); int num = material->findTexture("albedo"); //diffuse if (num != -1) { ImagePtr myImage = Unigine::Image::create(importImage); material->setTextureImage(num, myImage); } } But the mesh object is always null. How can I get the mesh object correctly ? Thanks for any advice . @silent @bmyagkov Really need your help. Edited June 7 by leon.dong Link to comment
Recommended Posts