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
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. mn-kb3d
    3. Posts
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by mn-kb3d

    • Adding UVs to Ngons in C++

      Hello!

      I'm currently working on an importer using C++. I want to support importing meshes with faces that can be tris, quads, and ngons.

      I'm currently able to construct the mesh by using the Modeling class and constructing each face as an "ngon" by doing the following:

      modeling->CreateNgon(polyObj, faceIndexList.data(), faceIndexList.size());
      

      where faceIndexList contains a list of points that make up that face.

      The final thing I need to do is to add UVs to the constructed mesh. For faces with tris and quads, this is no problem using UVWTag and UVWStruct.

      The issue comes in when trying add UVs for faces with a number of points greater than 4. I'm not quite sure how I would go about constructing a UVWStruct object for a face with 5 points, for example.

      I feel like the move is to not use a UVWTag here, but I'm not quite sure what my alternatives are. Is there a way to directly set the UV of a specific point in a mesh? Or is this a candidate for a CustomDataTag?

      posted in Cinema 4D SDK c++ 2024
      M
      mn-kb3d