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

    MAXVALUE_FLOAT [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 502 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 03/03/2015 at 03:32, xxxxxxxx wrote:

      In the manual I read:

        
      GeDialog.SetFloat(id, value[, min=MINVALUE_FLOAT][, max=MAXVALUE_FLOAT][, step=1.0][, format=FORMAT_FLOAT][, min2=0.0][, max2=0.0][, quadscale=False][, tristate=False])  
      

      However when I use following code, it gives me an error "MAXVALUE_FLOAT UNDEFINED".

      Using c4d.MAXVALUE_FLOAT it tells me "object has no attribute MAXVALUE_FLOAT"

        
      self.SetFloat(MY_RADIANTPOWER, 50.0, 0.0, max=200.0, step=1.0, max2=MAXVALUE_FLOAT)  
      

      -Pim

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

        On 03/03/2015 at 15:51, xxxxxxxx wrote:

        Hi Pim,

        The quick answer to your question is that I can confirm that it, along with related values, do not appear as c4d.MAXVALUE_FLOAT.  I'll have to dig deeper to find out why, or if they are accessed some other way (I know just writing MAXVALUE_FLOAT doesn't work either).

        The value MAXVALUE_FLOAT, set to MAXVALUE_FLOAT64 for 64 bit versions of C4D, is:

        MAXVALUE_FLOAT64 =  1.7976931348623158e+308

        Joey Gaspe
        SDK Support Engineer

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

          On 04/03/2015 at 00:50, xxxxxxxx wrote:

          Thanks, I await your answer.

          -Pim

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

            On 04/03/2015 at 07:16, xxxxxxxx wrote:

            Hi Pim,

            I've been informed that sys.float_info.max returns the same value, and is what should be used.  The documentation will be edited to state this, but you get to know this now.  Note: You have to import sys.

              
            import c4d  
            import sys  
              
            def main() :  
              print(sys.float_info.max)  
            

            Joey Gaspe
            SDK Support Engineer

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

              On 04/03/2015 at 08:17, xxxxxxxx wrote:

              Thanks Joey.
              I will use these values.

              I guess it is about the same for Int32 and Int63 max values.

              -Pim

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

                On 04/03/2015 at 08:21, xxxxxxxx wrote:

                Hi Pim,

                Yes, you should use the limits returned by Python using the same kind of calls for the other fundamental data types (integers, etc.) as described in Python's documentation.  I'll close this topic as solved.

                Thanks for letting us know!

                Joey Gaspe
                SDK Support Engineer

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