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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Retrieving Object Data Problem

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 276 Views
    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 Offline
      Helper
      last edited by

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

      On 28/12/2004 at 05:52, xxxxxxxx wrote:

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

      ---------
      <CODE>objectsChunk *_FormatSave::getObjData(BaseObject *obj)
      {

      ...

      Polygon *poly = (Polygon * ) obj->GetTagData(Tpolygon);
           Vector *point = (Vector * ) obj->GetTagData(Tpoint);
           LONG numPolygons = obj->GetTagDataCount(Tpolygon);
           LONG numVerts = obj->GetTagDataCount(Tpoint);

      ...

      block->verts = new Vector3[numVerts];

      for (i = 0; i < numVerts; i++) {
           
                block->verts _.x = point _.x;
                block->verts _.y = point _.y;
                block->verts _.z = point _.z;

      }

      ...

      }</CODE>

      Is this correct? it's seems to be wrong because the "obj->GetTagDataCount(Tpoint)" and "obj->GetTagDataCount(Tpolygon)" are returning 0 values, in scenes that have a cube object (i'm completely c4d noob too, i got c4d just for coding).

      obs.: the "BaseObject" parameter of "objectsChunk *_FormatSave::getObjData(BaseObject *obj)" method is receiving data from the following call (modified for obvious reasons) :

      <CODE>getObjData( BaseDocumentInst->GetFirstObject() );</CODE>

      I started learning/coding c4d today and got some progress. I'm building this plugin to export/import my own data format and thus use it to load from my game engine.

      And one more thing, there is a easy way to debug my plugin project, like using printf()?

      Thanks in advance.

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

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

        On 28/12/2004 at 08:12, xxxxxxxx wrote:

        i made some mistakes

        block->verts.x = point.x;
        block->verts.y = point.y;
        block->verts.z = point.z;

        should be:

        block->verts _.x = point _.x;
        block- >verts _.y = point _.y;
        block- >verts _.z = point _.z;

        and the language is C++

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

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

          On 28/12/2004 at 08:31, xxxxxxxx wrote:

          solved the problem

          i was using a Cube Object, not a Polygon Object (oh god \o/)

          and downloaded the Cinema 4D R8 SDK Help and discovered the GePrint() method from c4d_gerenal 🙂

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