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

    Select object in editor

    SDK Help
    0
    3
    263
    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
      Helper
      last edited by

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

      On 09/02/2004 at 06:59, xxxxxxxx wrote:

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

      ---------
      I tried to do a simple plane...code in GetrVirtualObjects:
       Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA);  // check if cache is valid
       if (!dirty) return op->GetCache(hh);       // if still valid, return cache

      BaseContainer *pdata = op->GetDataInstance();     // get container
       LONG sizeX = pdata->GetLong( LONG_SIZEX );      // get width
       LONG sizeY = pdata->GetLong( LONG_SIZEY );      // get height
       
       PolygonObject *object = PolygonObject::Alloc( 4, 1 );   // polygon with 4 points
       Vector *ppoint = object->GetPoint();       // set corner points of plane
       
       ppoint[0] = Vector( -100, -100, 0 );
       ppoint[1] = Vector( -100, 100, 0 );
       ppoint[2] = Vector( 100, 100, 0 );
       ppoint[3] = Vector( 100, -100, 0 );

      Polygon *ppolygon = object->GetPolygon();      // set point order
       *ppolygon = Polygon( 0, 1, 2, 3 );

      op->Message( MSG_UPDATE );          // update

      return( object );
      My problem is, that I cannot activate the object when I click in the editor...at least not within the bounding box, when I click close to the center point of the plane, its activated. And the strange thing: If I dont return an object like above, but only return NULL...when I can activate the object by a click within the bouding box ( defined in GetDimension ).....

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

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

        On 09/02/2004 at 16:36, xxxxxxxx wrote:

        I think C4D automatically will use the bounding box of the actual geometry you return for selection. The problem is with this line:

            
            
            op->Message( MSG_UPDATE );
        

        If you change it to

            
            
            object->Message( MSG_UPDATE );
        

        then your code seems to work. With the original version "object" didn't know it had any polygons, so when C4D asked it for a bounding box it returned the null box.

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

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

          On 09/02/2004 at 23:41, xxxxxxxx wrote:

          Right, that sounds logical, and it works, thank you 🙂

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