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

    How to set a slider?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 373 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 01/01/2008 at 06:46, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.5 
      Platform:      Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,

      How can I set a value in a slider? With
      > GetFloat(SLIDER);
      I can read out the slider value but
      > SetFloat(SLIDER, x);
      doesn't work.

      Thanks in advance!!

      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 01/01/2008 at 14:31, xxxxxxxx wrote:

        This should be the same in C++, no?

        BTW, how do you know how to access GUI elements? They are not documented in the SDK...

        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 01/01/2008 at 18:47, xxxxxxxx wrote:

          Yes ...

          I also found out it's not working in the way it should (or we hope it will) ...

          I tried this tricky way ... but in C++ ...
          But it may not be a good way ...

          Code In CreateLayout

          AddEditNumber(9990,0,100,10);
          SetReal(9990,50,0,200);

          GroupBegin(9991,0,1,1,"",0);
               AddSlider(9992,0);
               SetReal(9992,50,0,200);
          GroupEnd();

          Code In Command

          case 9992:
               {
                    Real r;
                    GetReal(9992,r);
                    SetReal(9990,r);
               }
               break;

          case 9990:
               {
                    Real r;
                    GetReal(9990,r);
                    LayoutFlushGroup(9991);
                    AddSlider(9992,0);
                    SetReal(9992,r,0,200);
                    LayoutChanged(9991);
               }
               break;

          Just try to use the slider and the text will change on the fly ...
          But type in the text ... you need to press ENTER to see the change in SLIDER ...

          So I think you can do it the same way in COFFEE ...
          Put your slider in a group ... and refresh the layout after changing its value ...

          Wishing you can do it ...
          Zaw Min Tun

          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 03/01/2008 at 16:38, xxxxxxxx wrote:

            You used a Slider and transformed it into some sort of EditSlider?

            Well, I tried this with a simple Slider component:

            > value = GetInt(IDC_SLIDER);

            This returns the actual value of the slider. But the reverse:

            > SetInt(IDC_SLIDER, 50);

            Does not work. I get the error: "Too few parameters". How do I know how many parameters the Slider wants? I can't find anything in the sdk manual.

            BTW, I also tried:

            > SetInt(IDC_SLIDER, 50, 0, 100);

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