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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Bug in C.O.F.F.E.E. node [SOLVED]

    SDK Help
    0
    5
    373
    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
      Helper
      last edited by

      On 04/01/2015 at 09:10, xxxxxxxx wrote:

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

      ---------
      Hi,

      I have an xpresso file with a C.O.F.F.E.E. node.
      This is the code:

      main()
      {
        if (body == 0)
            {
                arms = 0;
            } elif (body == 1) {
                arms = 1;
            } elif (body == 2) {
                arms = 1;
            } elif (body == 3) {
                arms = 1;
            } elif (body == 4) {
                arms = 2;
            }
      }

      Where body and arms are two variables of the type integer.
      But I get a COFFE ERROR! Variable or function expected
      Line: 6
      Row: 13
      which is, after the first elif, and after the open parenthesis: body, which is a variable.

      Does somebody see the problem here?
      Thanks in advance for your help! 🙂

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

        On 04/01/2015 at 23:53, xxxxxxxx wrote:

        Hi,

        "elif" keyword doesn't exist in C.O.F.F.E.E.
        Use "else if" instead.

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

          On 05/01/2015 at 02:15, xxxxxxxx wrote:

          Hi,

          Thanks for your answer!
          I should clearly pay more attention to which language I'm using.
          Guess I'm too much used to Python 😛

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

            On 05/01/2015 at 05:52, xxxxxxxx wrote:

            Howdy,

            You could also simplify your code like this:

            main()
            {
            	arms = body;
            	if(body > 1 && body < 4) arms = 1;
            	else if(body > 3) arms = 2;
            }
            

            Adios,
            Cactus Dan

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

              On 05/01/2015 at 06:08, xxxxxxxx wrote:

              That's right!

              Thanks for your help!!

              Greetings,
              Casimir Smets

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