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

    Melange data on Display Tags [SOLVED]

    SDK Help
    0
    5
    459
    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 14/06/2016 at 11:20, xxxxxxxx wrote:

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

      ---------
      I've just been getting started diving into Melange, and the first problem I've encountered is that getting parameters from a Display Tag returns incorrect data. It seems to return the default state of the tag data rather than any changes made in the file.

      My file consists of a single cube with a display tag on it with Visibility toggled on, and set to 69%, and Textures toggled off. The Use option for both Visibility and Textures is also toggled on.

      if (tag->GetType() == Tdisplay) {
          if (tag->GetParameter(DISPLAYTAG_AFFECT_VISIBILITY, data)) {
              if ((bool)data.GetBool()) {
                  printf("\n   \+ Visibility Active = true");
              } else {
                  printf("\n   \+ Visibility Active = false");
              }
          }
        
          if (tag->GetParameter(DISPLAYTAG_VISIBILITY, data) && data.GetFloat()) {
              printf("\n   \+ Visibility = %f", data.GetFloat());
          }
        
          if (tag->GetDParameter(DISPLAYTAG_TEXTURES, data)) {
              if ((bool)data.GetBool()) {
                  printf("\n   \+ Textures = true");
              } else {
                  printf("\n   \+ Textures = false");
              }
          }
      }
      

      this prints out:

        \+ Visibility Active = false
        \+ Visibility = 1.000000
        \+ Textures = true
      

      This result does not reflect the actual file, which should have visibility active set to true, with a value of 69.0, and textures set to false.

      However, if I get the parameters of the phong tag, or I add a compositing tag and make adjustments, both of those return accurate data, so I'm confident my parameter requesting code is not the problem.

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

        On 14/06/2016 at 13:06, xxxxxxxx wrote:

        for what it's worth, the only display tag parameter that appears to be accurate is DISPLAYTAG_SDISPLAYMODE, all other parameters report the same default values that are in place when the tag is first created, regardless of what the actual saved values are.

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

          On 15/06/2016 at 03:13, xxxxxxxx wrote:

          Hello,

          this seems like a bug in the Melange library. Thanks for reporting this, a bug report was filed.

          An alternative to accessing a parameter using GetParameter() is to access the data stored in the BaseContainer. It seems that the data stored in the BaseContainer is correct:

            
          BaseContainer bc = tag->GetData();  
            
          const Bool affectVisibilityFromBC = bc.GetBool(DISPLAYTAG_AFFECT_VISIBILITY);  
            
          if(affectVisibilityFromBC)  
          {  
            printf("affect Visibility\n");  
            
            const Float visiblity = bc.GetFloat(DISPLAYTAG_VISIBILITY);  
            
            printf("Visibility = %f \n", visiblity);  
          }  
          

          Best wishes,
          Sebastian

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

            On 16/06/2016 at 09:49, xxxxxxxx wrote:

            Great, thanks so much! I'll give this code a try shortly. I also tried to file a bug report myself via the [email protected] email that is listed on the About page, but it got bounced back, saying that address doesn't exist.

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

              On 17/06/2016 at 01:28, xxxxxxxx wrote:

              Hi,

              we are terribly sorry about the wrong email address. We originally planned to have a dedicated email address, then dumped that idea and completely forgot to change the About page. 😠
              Thanks for pointing it out. The About page got corrected.
              In short: For bug reports either use the Bug Report subforum[URL-REMOVED] here in Plugin Café or send a mail to our usual address [email protected].
              Sorry for any inconvenience caused.


              [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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