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

    Detecting The Link Object Of UserData field.

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 447 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 12/12/2010 at 07:14, xxxxxxxx wrote:

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

      ---------
      Hi All,

      I have  simple problem here.
      In an empty scene, create a camera with a UserData field called "Link" and of the link type.

      Now, add an expresso TAg to the camera and drop in the Camera, A COFFEE node and a Result node.

      Connect the UserData field to the input of the COFFEE node and the Output to the Result.

      Here is the code:

      main()
      {
      	if (Input1 == NULL)
      	{
      		Output1 = 0.0;
      	}
      	else
      	{
      		Output1 = 1.0;
      	}
      }
      

      Quite simple, if there is no object in the UserData link field, it outputs 0, if there is, it outputs 1.

      But this does not work. Can anyone explain why, and how to make it work?

      Thanks

      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 12/12/2010 at 12:40, xxxxxxxx wrote:

        Change NULL to nil. 😉

        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 12/12/2010 at 13:09, xxxxxxxx wrote:

          Hi Dragon Seer, that code works for me...

          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 13/12/2010 at 06:32, xxxxxxxx wrote:

            Thank you, that does work. but I have to ask...

            What is the difference between NULL and nil?

            They both highlight as orange keywords in the editor...

            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 13/12/2010 at 07:31, xxxxxxxx wrote:

              Afaik nil stands for an undefined status in COFFEE. For instance if a variable hasn't been initialized.

              cheers,
              Matthias

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