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

    How to Obtain the .FBX Points of Objects in C++

    Cinema 4D SDK
    s26 c++ macos windows
    2
    3
    538
    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.
    • P
      pchg
      last edited by

      Hello colleagues,
      I used C++ to write the C4D S26 plugin on Windows 10, I import .FBX and want to obtain the world coordinates of each point in the composite shape. Thanks in advance!
      100.png
      101.png

      BaseObject* obj = doc->GetActiveObject();
      PointObject* pointObj = static_cast<PointObject*>(obj);
      Int32 pointCount = pointObj->GetPointCount();		
      Vector* points = pointObj->GetPointW();
      const ::Matrix globalMtx = pointObj->GetMg();
      for (Int32 i = 0; i < pointCount; ++i)
      {
        Vector site = pointObj->GetMg() * points[i];
        GePrint("Frame " + String::IntToString(count) + ": " + String::VectorToString(site));
      }
      

      so, The point I picked is for this polygon
      102.png

      but,The coordinates I want are this combination image

      103.png

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @pchg
        last edited by

        Hello @pchg,

        Thank you for reaching out to us. FBX has nothing to do with your question, as when you encounter your problem, the data long have been converted into Cinema 4D's scene format.

        The reason why you encounter this discrepancy is because you access the points of the scene object instead of its deform cache. And since your horse model is under the influence of bones, it holds that deformed state in its deform cache. You can access that cache with BaseObject::GetDeformCache (S26.1). But note that this cache just as the generator cache is not always populated. In C++ we do not have a meaningful documentation of the geometry model, but we have one for Python. I would recommend having a look at it, especially geometry_caches_s26.py to understand how object caches work.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        P 1 Reply Last reply Reply Quote 0
        • P
          pchg @ferdinand
          last edited by

          @ferdinand Thank you for your reply

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