Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    TexData matrix?

    SDK Help
    0
    3
    302
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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?

      -CMPX

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

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

        Hello,

        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,
        Sebastian

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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).

          -CMPX

          1 Reply Last reply Reply Quote 0
          • First post
            Last post