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

    Did "evaluate()" change from 11 to 11.5?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 313 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 22/01/2010 at 19:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.5 
      Platform:      Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Evaluate() functions differently in 11.5 than it did in previous versions and its killed many of my distributed plugins.

      I've written a LOT of code in coffee that allows the user to specify values inside of the names in a hierarchy, or that pulls such values along with other useful information from a standardized file format outside of my controll. As long as the number, decimal point, whitespace, or negative sign was the first part of the name, I could use evaluate to extract the number. It seems a lot of my plugins are now broken with 11.5 because evaluate now returns a "nil" if the string being evaluated contains string values that are not numbers. Is this an error, or was I just taking advantage of an old leak that got fixed with 11.5?

      For example you can quickly try this in a coffee tag, in versions 9.x to 11.027
      main(doc,op)
      {
      println(" evaluation = ", evaluate("15_globular") );
      }

      prints evaluation = 15.000000 to the console
      the exact same code in 11.5 prints "evaluation = nil" to the console

      In a much bigger problem, evaluate in 11.5 fails to ignore certain tokens. I have distributed plugins that take a string parsed from a standard format like " -0.1365" and use evaluate to return the number -0.136500, but 11.5 sees the space:negative combination and returns a nil. I now have to parse the number and will have to update all of my plugins if evaluate will continue to function like this. Please tell me its a bug that will change on the next update.

      To recap:                                           <11.025            11.5
      evaluate("     .1365")                   0.136500          0.136500
      evaluate("-.1365")                     -0.136500        -0.136500
      evaluate(" -.1365")                    -0.136500           nil
      evaluate(" -.1365_molecule")    -0.136500           nil

      I personally hope we can return to the version that does lots of parsing automatically, but if not, I need to know what the new rules are so I don't keep producing shortcut code that will become obsolete.
      Thanks,
      Graham

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/02/2010 at 17:31, xxxxxxxx wrote:

        Any news on this? – Thanks, G

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 02/02/2010 at 07:32, xxxxxxxx wrote:

          This is intentional, otherwise you couldn't evaluate something like this, evaluate("pi05 * 3") , because the numbers of pi05 would be evaluated as well.

          cheers,
          Matthias

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 02/02/2010 at 12:11, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            evaluate(" -.1365")                    -0.136500           nil

            This case should work and therefore is under investigation.

            Best regards,

            Wilfried Behne

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