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

    Function in the Script Manager?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 241 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 03/01/2012 at 06:15, xxxxxxxx wrote:

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

      ---------
      Hi,

      In the Script Manager Window, is is possible to write a small script that contains functions? This does not work:

      var a = 8;   
      a = a + 2;   
      output_var(a);   
        
      output_var( n ) {   
         println(n);   
      }
      
      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 03/01/2012 at 06:46, xxxxxxxx wrote:

        Yes, but you need to do it like this:

          
        output_var( n ) {   
           println(n);   
        }   
        main(doc, op)   
        {   
             var a = 8;   
             a = a + 2;   
             output_var(a);   
        }   
        

        My understanding is that the entry point for the script is the main() function, so that must be included. And you don't need your forward declaration of the function.

        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 03/01/2012 at 06:48, xxxxxxxx wrote:

          Ok, thank you very much. I will try this out.

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