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
    • Recent
    • Tags
    • Users
    • Login

    Access to TextureTag

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 424 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 04/12/2008 at 08:08, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I am trying to export a textured object using the cpp SDK.
      The TextureTag object gives access to position,
      scale an rotation values, but these dont correspond to
      the values I entered in Cinema 4D.

      There are several tabs in the Attribute-Manager for
      TextureTags: 'Tag' and 'Coordinates'. The values I receive
      with TextureTag::GetPos() etc are those under
      'Coordinates' but have no apparent effect on Appearance.
      Those under 'Tag' have the desired effect but I cant
      find how to access them.

      Exporting the scene in 'Cinema4D xml Format' suggests
      everything is there because the following snippet looks
      like an image of the object:

      <v6_texture level='6'>
      <vector x='0' y='0' z='0' />
      <vector x='22' y='100' z='100' />
      <vector x='0' y='0' z='0' />
      <matrix>
          <vector x='0' y='0' z='0' />
          <vector x='1' y='0' z='0' />
          <vector x='0' y='1' z='0' />
          <vector x='0' y='0' z='1' />
      </matrix>
      <matrix>
          <vector x='0' y='0' z='0' />
          <vector x='1' y='0' z='0' />
          <vector x='0' y='1' z='0' />
          <vector x='0' y='0' z='1' />
      </matrix>
      <real v='0.55000001192092896' />
      <real v='0.14999999105930328' />
      <real v='0.58499997854232788' />
      <real v='0.63999998569488525' />
      <bool v='1' />
      ....
      </v6_texture>

      The TextureTag Interface gives access to the vectors and
      matrices but how do I get to the reals and the rest?

      Thank you for any suggestions.

      (A general comment of the structure of the xml-files
      and how it corresponds to SDK data structure
      would be welcome. It would probably help answer many
      questions posted here.)

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 04/12/2008 at 09:02, xxxxxxxx wrote:

        The info you are looking for (tiling, scaling, etc values) are in the Container...

            
            
            
            
            BaseContainer tagvals = pTTag->GetData();  
            GePrint("TEXTURETAG_OFFSETX: " + RealToString(tagvals.GetReal(TEXTURETAG_OFFSETX)) );  
            GePrint("TEXTURETAG_OFFSETY: " + RealToString(tagvals.GetReal(TEXTURETAG_OFFSETY)) );  
            GePrint("TEXTURETAG_LENGTHX: " + RealToString(tagvals.GetReal(TEXTURETAG_LENGTHX)) );  
            GePrint("TEXTURETAG_LENGTHY: " + RealToString(tagvals.GetReal(TEXTURETAG_LENGTHY)) );
            
            
            
        

        etc. (look in "ttexture.h" for the full list of attributes)
        You might also want to look up "GenerateUVW()" in the SDK docs.  That will convert the various "Projection" types to UVW coordinates (including taking care of matrix operations, but it does NOT apply the offset and tiling adjustments, so you have to do those by hand).
        Actually, if you search the forum, I've got a thread somewhere that covers a lot of this.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 04/12/2008 at 09:23, xxxxxxxx wrote:

          Erm.. it was this thread.

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 04/12/2008 at 09:50, xxxxxxxx wrote:

            Just a note, you may or may not get the actual values doing it that way. The (R9.603) doc for BaseList2D::GetParameter states that TextureTag does not store its data in the container, so you are supposed  to use GetParameter directly. For example, I just tested this, and while the offset values were found in the container, the size values were not.
            Cheers,
            JD

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 04/12/2008 at 10:42, xxxxxxxx wrote:

              Thanks for the info... I'll go double-check and/or fix my code.

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