Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / Mesh texturing?
  RSS 2.0 ATOM  

Mesh texturing?
Rate this thread
 
63702
 
Permlink of this thread  
avatar
  • Romuuu
  • Posted: 20 January 2012 03:46 AM
  • Total Posts: 1
  • Joined: 20 January 2012 03:33 AM

Hello everybody,

For a study project, I have to create a plugin which loads a mesh (OBJ), and change the texture image file (which is stored on the disk, PNG files) several times, in relation with the current time in the timeline.
But my problem is, how to apply a texture to a mesh?

I know I have to do several steps :
- Create a blinn shader,
- Get the “surfaceShader” attribute from my mesh,
- Connect the Blinn “outColor” attribute to the Mesh “surfaceShader” attribute,
- Create a file node,
- Set the file node “fileTextureName” attribute to the image path,
- And connect the file node “outColor” attribute to the Blinn “color” attribute.

But I don’t know how to do this with the API (C++ for my project).

First problem :
When I do the first connection (material outColor -> mesh surfaceShader), the MDGModifier::connect function returns MStatus::kSuccess, but when I call the MDGModifier::doIt (just after), it returns kFailure.

And second problem:
How to create a file node?

Thanks a lot for your attention!

Romuuu



Replies: 0