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

    Querying value of a texture attribute

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 261 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 19/02/2009 at 16:56, xxxxxxxx wrote:

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

      ---------
      Hi All,

      In my plugin, I'm trying to determine the current value of a texture's animation mode. So I can get the string:

      > \> BaseContainer data = chan->GetData(); \> String timeMode = LongToString(data.GetLong(BASECHANNEL_TIME_MODE, 0)); \>

      Now I want test the value, my naive attempt:

      > \> if (timeMode == "Loop") \> { \>     // do some work \> } \>

      It doesn't seem right to me that I would hard code the actual "Loop" string though, is there a better way to implement this?

      Thanks!

      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 19/02/2009 at 18:54, xxxxxxxx wrote:

        OK, I just realized that my previous lame example makes no sense. "LongToString" is not what I want to do.

        So, If I get the data:

        > \> LONG timeMode = data.GetLong(BASECHANNEL_TIME_MODE, 0); \>

        how do I find out if the returned LONG value represents "Simple", "Loop", or "Ping-Pong"?

        I found resource/strings_us/description, which contain GITMAPSHADER_TIMING_MODE_SIMPLE, etc., but I'm not sure how to use it.

        Is this explained in the docs somewhere? If so, point me to it and I'll go away.

        Thanks!

        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 20/02/2009 at 00:27, xxxxxxxx wrote:

          The animation mode is a LONG description element with a CYCLE flag. Please have a look at the docu's 'LONG (description elelment)' chapter. CYCLE flag is used to create combobox like description elements. You can find the ID for each entry in the 'Xbitmap.h' file.

          Here is a little example:

          > \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      BaseMaterial \*bmat = NULL; \>      bmat = doc->GetFirstMaterial(); \> \>      if(bmat) \>      { \>           BaseChannel \*chn = NULL; \>           chn = bmat->GetChannel(CHANNEL_COLOR); \>           if(chn && chn->GetShaderID()==Xbitmap) \>           { \>                BaseContainer data = chn->GetData(); \>                LONG mode = data.GetLong(BASECHANNEL_TIME_MODE); \>                 \>                switch(mode) \>                { \>                     case BITMAPSHADER_TIMING_MODE_SIMPLE: \>                          // 'Simple' mode, do something \>                          break; \>                     case BITMAPSHADER_TIMING_MODE_LOOP: \>                          // 'Loop' mode, do something \>                          break; \>                     case BITMAPSHADER_TIMING_MODE_PINGPONG: \>                          // 'Ping-Pong' mode, do something \>                          break; \>                } \>           } \>      } \> \>      return TRUE; \> } \>

          cheers,
          Matthias

          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 20/02/2009 at 10:59, xxxxxxxx wrote:

            Perfect, thanks!

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