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

    random.seed() vs R21

    General Talk
    4
    5
    1.4k
    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.
    • brascoB
      brasco
      last edited by

      Hi,

      Can anyone confirm random.seed() is throwing an error in R21?

      alt text

      cheers,
      brasc

      1 Reply Last reply Reply Quote 0
      • CairynC
        Cairyn
        last edited by

        Nope. Same commands work fine here (R21.022)

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

          Hi,

          I cannot reproduce this neither. The interesting question would be what does print random.seed for you and is this reproduceable on your end?

          My suspicion would be that someone or something treated random.seed() like a property instead of like a function, which then led to - with all the "Python functions are first class objects" thing - random.seed being an integer. Something like this:

          >>> import random
          >>> print(random.seed)
          <bound method Random.seed of <random.Random object at 0x103b62218>>
          >>> random.seed(12345)
          >>> random.seed = 12345 # 'accidently' treating it like a property
          >>> print(random.seed)
          12345
          >>> random.seed(12345)
          Traceback (most recent call last):
            File "<string>", line 1, in <module>
          TypeError: 'int' object is not callable
          

          Cheers
          zipit

          MAXON SDK Specialist
          developers.maxon.net

          brascoB 1 Reply Last reply Reply Quote 2
          • ManuelM
            Manuel
            last edited by

            Hello,

            I couldn't reproduce this neither.
            As @zipit said in his last post, this could explain why you have this message.

            But relaunching cinema4D would reset everything.

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • brascoB
              brasco @ferdinand
              last edited by brasco

              @zipit Thanks for the insight! This makes sense, I vaguely recall typo-ing random.seed and forgetting the () and it threw an error so I fixed that, went writing more of the code and then didn't relate this error back to that brief moment. I don't recall assigning it as a property, but I do have a seed = 12345 elsewhere in the code, so maybe I did!

              Thanks all for sanity-checking it, solved.

              cheers,
              brasc

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