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

    Check User Data Link Field

    Cinema 4D SDK
    2
    3
    521
    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.
    • SwinnS
      Swinn
      last edited by

      Hi, is there a way to use Python to check if there is a link in a User Data field or if it is empty? Thanks.

      1 Reply Last reply Reply Quote 0
      • P
        PluginStudent
        last edited by

        What do you mean with "use Python"? Are you writing a script, or a plugin, or something else?

        You can simply access the user data parameter and see if it is None or not:

        link = op[c4d.ID_USERDATA,1]
        if link is None:
            print("no link")
        else:
            print("some object linked")
        

        Also: please post questions on the C4D API in CINEMA 4D DEVELOPMENT.

        SwinnS 1 Reply Last reply Reply Quote 1
        • SwinnS
          Swinn @PluginStudent
          last edited by

          @Swinn is None did the trick. Thanks. 🙂

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