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

    userdata work around

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 325 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 27/08/2009 at 05:57, xxxxxxxx wrote:

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

      ---------
      Hi
      I was hoping to find a way of gathering up all my userdata from a null to put into an array, but I saw from the forum that coffee might not support this

      <<"I'd like to check if an object has user data(s) , how many , and their name . Do you think it's possible in coffee ?">>

      is there a work around for this? could I make a null with one userdata field, then copy and paste as many as I need and in my coffee script loop through all the nulls of the same name to find out how many userdata fields there are, or is there a much simpler way?

      Kind regards Conor

      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 27/08/2009 at 07:27, xxxxxxxx wrote:

        Hi I've just been looking at kattkieru's post about "BaseContainer and user data". I have a null with two user data fields (one is 56 the other 24) and I've tried the code

        main(doc,op)
        {

        var op = doc->FindObject("userdata");

        var bc = op->GetContainer();

        var i = 0;

        while (bc->GetIndexId(i) != NOTOK)

        {

        println(bc->GetIndexData(i));

        i++;

        }

        }

        but I get

        0
        10.000000
        1.000000
        0
        [Object-0x17a1d32c]

        in the console window, have I completely misunderstood this code if I'm expecting it to print the contents of the user data?
        Kind regards Conor

        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 27/08/2009 at 08:01, xxxxxxxx wrote:

          It's not possible to iterate through userdata in COFFEE.

          Userdata can only be accessed directly in COFFEE, like this: var data = op#ID_USERDATA:1

          The only workaround is described in this thread:

          some COFFEE questions

          For full userdata access you have to use the C++ API.

          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 27/08/2009 at 08:12, xxxxxxxx wrote:

            Thanks Matthias, I'll give that a go.
            cheers
            Conor

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