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

    UVW values inconsistency

    Cinema 4D SDK
    r21 s22 c++ python
    3
    4
    828
    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.
    • rsodreR
      rsodre
      last edited by

      Hello,

      There's something I just noticed that is causing some confusion here...

      I create a 1x1 plane and make it editable, becoming just one square polygon. when I see it's UVWs in the Structure Manager, I get this:

      A=0,0,0
      B=0,1,0
      C=1,1,0
      D=1,0,0
      

      Butif I open it with C++ or Python API, I get different values, Y is inverted...

      doc = c4d.documents.GetActiveDocument()
      obj = doc.SearchObject("Plane")
      uvwtag = op.GetTag(c4d.Tuvw)
      uvwdict = uvwtag.GetSlow(0)
      print uvwdict
      
      'a': Vector(0, 1, 0) 
      'b': Vector(0, 0, 0) 
      'c': Vector(1, 0, 0) 
      'd': Vector(1, 1, 0)
      

      I checked on R21 and R22, both display that difference, why?
      But on R20 the API and Structure still have the same values.

      That makes me suspicious of Structure, which I always considered a valuable source.

      Thanks,
      Roger

      1 Reply Last reply Reply Quote 0
      • C4DSC
        C4DS
        last edited by C4DS

        In the past the UV editor showed the UVs with origin at top left, as this is also the origin of the UserArea.
        Notice that at that point, the UV canvas still didn't have any axis being displayed.
        When they started showing the axis (cannot remember if this was R20 or R21 ... I assume R21) they showed the axis the "right" way, with origin at the lower left. Thus actually switching displaying of the UVs in the Y direction.

        However, the data is still stored in the old fashion way (origin at top left). Which is what you'll see in the Structure Manager. But internally the Y value is flipped over to represent a lower-left origin in the UV View.

        Also note that the values (up to R21 at least) are single precision only.

        1 Reply Last reply Reply Quote 1
        • r_giganteR
          r_gigante
          last edited by

          Hi @rsodre, thanks for reaching out to us.

          With regard to your post, as already pointed out by @C4DS, it's related to the refactor of the UVEditor that took place in recent releases. The misalignment found in between the Structure Manager and the results brought back from the API it's likely to have been introduced to guarantee back-ward scene compatibility.

          However I see it as an unpleasant flaw that we have to look at and get it addressed in future releases.

          Best, R

          rsodreR 1 Reply Last reply Reply Quote 0
          • rsodreR
            rsodre @r_gigante
            last edited by

            @r_gigante good to know, thanks!

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