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

    3rd party customgui pointer

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 622 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

      On 02/04/2017 at 14:51, xxxxxxxx wrote:

      Is it possible to retrieve a customgui wich is not made by maxon? If not can it be considered as feature request?

      basicly doing this stuff

                  bc = c4d.BaseContainer()
                  bc.SetReal(c4d.DESC_MIN, 0.0)
                  bc.SetReal(c4d.DESC_MAX, 100.0)
                  bc.SetReal(c4d.DESC_STEP, 0.01)
                  bc.SetLong(c4d.DESC_UNIT, c4d.DESC_UNIT_FLOAT)
                 
                  CustomFloatSlider = self.AddCustomGui( 1001,  SLIDERGUI, "", c4d.BFH_SCALEFIT | c4d.BFV_SCALE,100,0,bc)
                  self.SetReal(1001, 50.05, 10.0, 20.0, 0.00001, min2=0, max2=100)
       
                  #Not working since CustomFloatSlider is a bool while a pointer to the gizmo is expected
                  #CustomFloatSlider.SetReal(1001, 50.05, 10.0, 20.0, 0.00001, min2=0, max2=100)
      

      Gedialog.FindCustomGui have a note about it but not addCustomGui.

      BTW if it's not possible since this customGui is just a customGUi who display all float decimal (and it's why I wanna it into my plugin).
      Is it possible to create a AddEditNumberArrows with a custom number of decimal? (I know ui can store all range of float but it only display 3decimal)

      Thanks in advance 🙂

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

        On 02/04/2017 at 23:24, xxxxxxxx wrote:

        If i right understand you^ you need slider like this? or not? https://drive.google.com/open?id=0B6LsRuoqyxhTdlhGUTdTeFJzRUU

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

          On 03/04/2017 at 00:42, xxxxxxxx wrote:

          No since in your case as you can see it's just a slider with DESC_UNIT set to DESC_UNIT_METER.
          Basicly I want the octane slider which is like that.
          http://img4.hostingpics.net/pics/556481octaneslider.jpg

          I have contacted them and they friendly share with me their c++ creation code.
          And the only part I can't replicate it's to get/set value from this custom gui since I don't have a reference to the CustomGui

          EDIT :
          Maybe it can help but basicly they do this:

          MyCustomFloatSlider *gui = (MyCustomFloatSlider * )AddCustomGui( ui_id, customGUi_id, String(), BFH_SCALEFIT|BFV_SCALE,100,0,bc);  
          gui->setValue(value, minVvalue, maxVvalue, slMin, slMax, step);
          

          And into this SetValue function they just do
          SetReal(ui_id,(Real)val, minVvalue, maxVvalue, step);

          But since in python the returned value of AddCustomGui is a bool and not an instance of c4d.gui.BaseCustomGui https://developers.maxon.net/docs/py/2023_2/modules/c4d.gui/BaseCustomGui/index.html
          I can't doing SetValue.

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

            On 03/04/2017 at 05:58, xxxxxxxx wrote:

            Hi,

            I'm afraid that's a limitation of the Python API.
            A 3rd party custom Gui can be added to a dialog but its actual object is not returned from AddCustomGui() or FindCustomGui().
            In such case these functions only return True and that's not really helpful (there's no way to get/set the custom Gui data).
            We are aware of this limitation and it's already in our Todo list.

            Note: There are no pointers in Python 🙂

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

              On 03/04/2017 at 06:04, xxxxxxxx wrote:

              Ok I was afraid of this kind of answerd. But thanks for taking time to answerd me.
              I know it's more easy to say than to do but in feature release it would be nice to have at least the possibility to get the container of the CustomGUi.

              Is there any way for displaying more than 3 decimal into a AddEditNumberArrows ?

              Haha yeah looks like in a month of c++ I start to think only in c++. It's a great news for me.

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