TexData matrix?

On 07/01/2016 at 03:51, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R17 
Platform:    Mac  ;  
Language(s) :     C++  ;

What is the recommended way to get the matrices from a TexData object?

The documentation says this about m (and presumably im) :

This actual value may differ from those specified in the dialog, these are a precalculated raytracer representation.

This seems to be the case... 100% of the time. No matter what I do, whenever I try and access the active texdata in a shader (via cd->vd->tex->m or cd->vd->tex->im), it doesn't line up at all with what the texture tag says in the attribute manager.

How can I get the matrix for the information configured in the texture tag? How does the (SLA?) noise shader do it when configured for Texture mode?


On 08/01/2016 at 01:17, xxxxxxxx wrote:


the SLA noise shader actually dose use TexData::im for its texture space operation.

If you want to access the original values you could access the original texture tag with TexData::link and and read the individual values from the TextureTag class.

Best wishes,

On 08/01/2016 at 06:32, xxxxxxxx wrote:

Is it just using TexData::im, or is it using something else?

Over here, when I try and access the TexData attached to the cd->vd->tex pointer, m and im are always the same (no offset, no rotation, length of 100 on v1/v2/v3). No matter what I do in the attributes manager for the relevant tag, those values do not change.

It seems like it's easy enough to just go through cd->vd->tex->link instead, but this doesn't seem proper when m and im exist for that purpose (plus I need to invert the matrix returned by ((TextureTag * )cd->vd->tex->link)->GetMl(), whereas cd->vd->tex->im is already inverted).