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

    Get UV coords of an object

    SDK Help
    0
    3
    211
    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
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 24/04/2006 at 14:26, xxxxxxxx wrote:

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

      ---------
      Hello everybody.

      For a use in a game 3D engine, I need to retrieve the UV coordinates of objects created in Cinema 4D, so after having read the COFFEE documentation and being helped by some old topics on this forum, I concluded that UV coords were stored in a VariableTag object in which the data array can be obtained using the GetData() function (and the size of the data array by the GetDataCount() function).

      Maybe I'm wrong, but I think the UV coordinates are stored following the polygon order, that is to say : UVa, UVb, UVc, UVd for the 1st polygon, UVa, UVb, UVc, UVd for the 2nd polygon, etc...
      But, when I try to get the UV coords of an object containing n polygons, the size of the data array I retrieve (known using GetDataCount()) is not 4*n (4 vertices * n polygons) but n, so I only get partially the UV data.

      I really don't know where I'm mistaking, and once again, I would appreciate some help from more experienced programmers than me.
      Thank you.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 25/04/2006 at 02:15, xxxxxxxx wrote:

        I think GetDataCount() refers to the polygon count, not the actual array size. Have a look at the variable tag section in the docs.
        The array should really be 4*n elements in size.. so just access the data as you intendend. I'm sure it will be alright.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 25/04/2006 at 09:07, xxxxxxxx wrote:

          Yes, you're right. Accessing more simply to the data without taking care of GetDataCount() was the solution.
          Thank you very much.

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