Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Sliders in Python plugin

    Cinema 4D SDK
    sdk python 2023
    4
    5
    938
    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.
    • F
      filipst
      last edited by filipst

      Hi,

      I'm trying to learn how to write a Python plugin that generates a spline, using the examples you have on Github.
      I'm basing it mostly on the "py-double_circle_r19" example.

      One of the things I'm having issues with is with the custom controls.
      I can add them, for example like this in the .res file:

      		REAL PYROUNDRECT_HEIGHT { UNIT METER; MIN 0.0; }
      		REAL PYROUNDRECT_WIDTH { UNIT METER; MIN 0.0; }
      

      but they only have a text box, no slider. How do I add sliders to them?

      Thank you.

      chuanzhenC 1 Reply Last reply Reply Quote 0
      • chuanzhenC
        chuanzhen @filipst
        last edited by

        @filipst example:

        REAL PYROUNDRECT_HEIGHT { UNIT METER; MIN 0.0; CUSTOMGUI REALSLIDER;}
        

        50f1b826-6663-4e81-91c7-796588ba56b3-image.png

        相信我,可以的!

        1 Reply Last reply Reply Quote 0
        • F
          filipst
          last edited by

          Thank you, it works!

          Another question if you don't mind. What's the best/recommended way to limit one of these values based on other values?
          For example, like how the corner radius on the Rectangle spline that comes with C4D is limited by the width or height of the rectangle?
          Where in the plugin would the code for this go?

          1 Reply Last reply Reply Quote 0
          • i_mazlovI
            i_mazlov
            last edited by

            Hello @filipst,

            Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!

            Getting Started

            Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:

            • Support Procedures: Scope of Support: Lines out the things we will do and what we will not do.
            • Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon.
            • Forum Structure and Features: Lines out how the forum works.
            • Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner.

            About your First Question

            As @chuanzhen absolutely rightly pointed out, you can find the list of available description element types on the corresponding documentation page: Description Resource. Please note that some parts of documentation are better available on C++ category even though also related to Python workflow.

            Let me know if you have any further questions.

            Cheers,
            Ilia

            MAXON SDK Specialist
            developers.maxon.net

            ferdinandF 1 Reply Last reply Reply Quote 0
            • ferdinandF
              ferdinand @i_mazlov
              last edited by

              Hello @filipst,

              Without further questions or updates we will consider this topic as solved by Friday the 11th, and flag it accordingly.

              Cheers,
              Maxon SDK Group

              MAXON SDK Specialist
              developers.maxon.net

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