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

    GUI shows M (meters) instead of CM (centimeters) in CUSTOMGUI_VECTOR

    Cinema 4D SDK
    c++
    2
    4
    622
    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.
    • E
      ECHekman
      last edited by

      I programmatically create a vector gui using CUSTOMGUI_VECTOR. I set DESC_UNIT to DESC_UNIT_METER.
      However the gui will show CM after the number. And i would like it to display M for meter at the end of the number.
      I cant find in the SDK how to do this

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

        Hey @ECHekman,

        Thank you for reaching out to us. Cinema 4D is unitless, you cannot set a value to CM or M. The description flag is meant abstractly, a better name might have been DESC_UNIT_DISTANCE, as that is all it will do, enforce that values are decorated with a unit symbol for the chosen unit of distance.

        I not too long ago explained here how units work in Cinema 4D.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • E
          ECHekman
          last edited by

          Ok that makes a lot of sense. Ill see what i can do on my end then

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

            Hey,

            it seems I was a bit too tightlipped here. So in more verbose: You cannot customize the chosen unit of a parameter. This is impossible as this is a globally set value (which is also just smoke and mirrors as explained in the link above). There is a UnitScale custom GUI but it does not what you want, it is the field used in the document settings and is not really meant to store a value and unit but just a unit.

            image.png

            When you really-really-really want this, you can implement you own custom GUI, either targeting your own custom data types or existing data types. There you could then do whatever you want. But that might not mesh so well with the rest of Cinema 4D, given that Cinema 4D does not operate like that.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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