Can someone please explain MTex objects ?


I have a hard time figuring out the MTex( class.

Here are the things that puzzle me:

  • It has no constructor ? ‘one cannot just walk into mordor’ :slight_smile: I can’t just create a MTex object. The only I’ve seen it get created is when calling material’s setTexture() and creates a MTex (Material) object. The World class doesn’t have a setTexture() method, so I don’t know how to create one for the world.
  • Although it’s just one class, there are at least two kinds of MTex ? MTex (World) and MTex (Material). Some properties are applicable only for world MTex objects while others just for material. Some are list for ‘material and world only’, does that mean there’s more than those two ?

How ? What ? I’m confussed…
Can you even create (World) MTex objects ? How do those get initialized ?

MTex is the join between a Material and a Texture. It specifies how the texture is to be applied, what channel it resides in, and what it affects, for that material.

That bit I understood :slight_smile:

How do I create a World MTex ? calling setTexture on a Material creates a link between a material and a texture => Material MTex. Equivalent for World ?