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
    The forum rollback caused push notifications and recent user data to malfunction. The problem will fix itself naturally within the next days. See the topic Broken Push Notifications for a more in detail explanation. You can fix this yourself by forcibly clearing your browser cache (for most browsers: CTRL + F5).

    TempUVHandle always None! Why?

    Cinema 4D SDK
    r21 python windows
    2
    3
    509
    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.
    • ThomasBT
      ThomasB
      last edited by

      Hi,
      I am not able to get the TempUVHandle from an active UVWTag in R21.
      It returns always "None".
      In the following script I created a simple plane in a TempDoc and took the cache and inserted it into the TempDoc. It already has a UVW-Tag, then I have set the object active and so the UVWTag....

      My Code:

      import c4d
      
      def main():
          temp = c4d.documents.BaseDocument()
      
          plane = c4d.BaseObject(c4d.Oplane)
          temp.InsertObject(plane)
          temp.ExecutePasses(bt=None, animation=False, expressions=False, caches=True, flags=c4d.BUILDFLAGS_NONE)
          
          plane_cache = plane.GetCache().GetClone()
      
          if plane_cache is None:
              raise Exception("no cache")
      
          temp.InsertObject(plane_cache)
          uvw_tag = plane_cache.GetTag(c4d.Tuvw)   
          temp.SetActiveTag(uvw_tag)
          temp.SetActiveObject(plane_cache)
      
          handle = c4d.modules.bodypaint.GetActiveUVSet(temp, c4d.GETACTIVEUVSET_UVWS)
          
          print(handle)
          
      
      # Execute main()
      if __name__=='__main__':
          main()
      

      Thanks,
      T.S.B

      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @ThomasB
        last edited by

        Hi @ThomasB,

        Please note that R21 is generally out of scope of full support on this forum. I've tried your code with the oldest C4D version I have (which is R25) and I cannot reproduce your issue.

        However, looking in your code it seems like you might need an additional handling for the case when the texture view is not open, please have a look at the comment in our example: call_uv_command_r18.py .

        You can also find some useful information on a similar thread, where Ferdinand gave some insights about GetActiveUVSet function: GetActiveUVSet() returns None if multiple UVs are active?.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        ThomasBT 1 Reply Last reply Reply Quote 0
        • ThomasBT
          ThomasB @i_mazlov
          last edited by ThomasB

          @i_mazlov
          Thank you very much for the hint with the texture view and for the helpful links.
          The second thread I have already read, but was not able to find the solution so far. I study these examples. Thank you.

          Thanks,
          T.S.B

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