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

    DescLevel, DescID, part 1502

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 374 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/03/2009 at 02:13, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:    Mac  ;  
      Language(s) :     C++  ;

      ---------
      Hi 🙂

      I am sorry, but whyever, my head don't want to understand how to work with this stuff seriously.

      I rewrite the part where to get/set values of BaseList2D objects. For example: To get a segments count of a sphere you can just call

      Sphere[1111] => Returns "24" on standard

      To return the first userdata element you can call
      Sphere[USERDATA_ID, 1]

      That looks nice and is easy to understand, but I have a problem to understand how to get a level down in an element ( depends on the element type, yes).

      For example, to get the x element of a vector I guess I have to check a new Level. How would you access this. Please note, you don't know the type of it.

      I thought I could do this
      Cube[1100, 1000] = > 1100 is the vector of the cube size and 1000 is the X element of it. Yes, I could just call Cube[1000] to return the whole vector but maybe just return the X component would be cool too.

      How would you access this type in C++?

      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 03/03/2009 at 02:26, xxxxxxxx wrote:

        How do you set/get your parameter, with Get/SetParameter()?
        If so why don't you use GeData::GetType() to retrieve the type?

        This is an example how to access a subchannel of the vector type:

        > \> DescID(DescLevel(ID_BASEOBJECT_POSITION,DTYPE_VECTOR,0),DescLevel(VECTOR_X,DTYPE_REAL,0)) \>

        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 03/03/2009 at 02:42, xxxxxxxx wrote:

          Yes, I can use GeData::GetType() when I already got the element, but I don't mean the type of GeData. In your code you use the types: DTYPE_REAL and DTYPE_VECTOR

          That means the user has to call this:

          > \> Cube[ (ID_BASEOBJECT_POSITION,DTYPE_VECTOR, 0) (VECTOR_X,DTYPE_REAL,0) ] \>

          This is just the python way. I would pass these ids to the DescID. In this case I have to pass the type. Could it be possible just to pass:

          > \> ID_BASEOBJECT_POSITION and VECTOR_X without the types? \>

          For example:

          > \> Cube[ (ID_BASEOBJECT_POSITION) (VECTOR_X) ] \>

          which would be much cooler.

          Bye.

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

            Ah, ok, now I got it. I have to do a bit research on my own. I guess it must be possible somehow as COFFEE is doing basically the same.

            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 04/03/2009 at 03:16, xxxxxxxx wrote:

              It seems that you have to get first the typ of each description level.

              For instance to change a cube's X length you would do something like this in Python I guess:

              > \> Cube[ (PRIM_CUBE_LEN) (VECTOR_X) ] \>

              In C++ you have to do something like this:

              - get the type of the first level

              > \> cube->GetParameter((DescLevel(PRIM_CUBE_LEN), d, 0) \>

              - get the type of the second level

              > \> cube->GetParameter(DescID(DescLevel(PRIM_CUBE_LEN,DTYPE_VECTOR,0),DescLevel(VECTOR_X)), d, 0) \>

              - now you all the necessary types to do something with the parameters

              I still have to wait for a final answer of the developers but I think this is how it's done.

              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 04/03/2009 at 05:44, xxxxxxxx wrote:

                yeap, i guess thats it. works fine 🙂 thx...

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