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
    • Register
    • Login

    GetAlphaGradient

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 285 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 20/07/2005 at 18:18, xxxxxxxx wrote:

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

      ---------
      I've been trying to figure out how to initialize a gradient's alpha without much luck.

      I have a gradient in my description with COLOR; and ALPHA; specified.
      In my plugin's Init I allocate a gradient with AutoAlloc, insert a few knots, and initialize the control with it.
      Works absolutely fine. Pretty standard stuff I think, but if you'd like me to post the code anyway, I would be glad to.

      The SDK docs (both 8.5 and 9.1) are pretty vague.
      The description for GetAlphaGradient reads: "Alpha gradient. The gradient owns the pointed knot.".

      Anyway, I can't seem insert any knots in the gradient's alpha, let alone get a pointer to the alpha gradient.

      Anyone have any success with this?

      -Chris

      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 24/07/2005 at 20:34, xxxxxxxx wrote:

        No one?

        I'll keep trying and let you know if I figure it out.

        -Chris

        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 27/07/2005 at 06:40, xxxxxxxx wrote:

          Hmm, it seems the documentation is missing the step in red:

              
              
              AutoAlloc<Gradient> g;  
              g->SetData(GRADIENT_MODE, GeData(GRADIENTMODE_COLORALPHA));
              
              
              
              
              GradientKnot k1;  
              k1.pos = 0;  
              k1.index = 0;  
              k1.brightness = 1.0;  
              k1.bias = 0.5;  
              k1.col = Vector(1,0,0);
              
              
              
              
              GradientKnot k2;  
              k2.pos = 1;  
              k2.index = 1;  
              k2.brightness = 0.5;  
              k2.bias = 0.8;  
              k2.col = Vector(0.5,0.5,0);
              
              
              
              
              g->InsertKnot(k1);  
              g->InsertKnot(k2);
              
              
              
              
              Gradient* ag = g->GetAlphaGradient();  
              if (ag)  
              {  
                  ag->InsertKnot(k1);  
                  ag->InsertKnot(k2);  
              }
              
              
              
              
              GeData d(CUSTOMDATATYPE_GRADIENT, g);  
              data->SetData(TESTGRAD, d);
          
          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 27/07/2005 at 06:53, xxxxxxxx wrote:

            Thanks Mikael. I will try that out soon.

            -Chris

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