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
    • Login

    Usin BaseDraw::DrawObject to draw spline

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 291 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 13/09/2008 at 09:32, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.1 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      I try to draw a spline in the HANDLES pass, using BaseDraw::DrawObject, but nothing is showing up. The result of DrawObject ir TRUE, so I guess it should have worked.

      Anything I have to be aware of?

      Thanks for any help!

      Greetings,
      Jack

      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 18/09/2008 at 07:08, xxxxxxxx wrote:

        You have to pass an LineObject instead of a SplineObject. Also since the spline was probably a primitive it does not exist in a draw pipeline yet. You better use GenerateSplinePrimitive(). See attached code of the modified AtomObject example.

        > \> class AtomObject : public ObjectData \> { \>      private: \>           LineObject \*line; \>      public: \>           virtual Bool Init(GeListNode \*node); \>           virtual void Free(GeListNode\* node); \>           virtual Bool Draw(BaseObject\* op, LONG drawpass, BaseDraw\* bd, BaseDrawHelp\* bh); \>           virtual BaseObject\* GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh); \> \>           static NodeData \*Alloc(void) { return gNew AtomObject; } \> }; \> \> Bool AtomObject::Init(GeListNode \*node) \> { \>      BaseObject          \*op          = (BaseObject\* )node; \>      BaseContainer \*data = op->GetDataInstance(); \> \>      BaseContainer bc; \>      BaseObject \*spline = NULL; \>      spline = GenerateSplinePrimitive(node->GetDocument(), Osplinestar, bc, 1.0, NULL); \>      if(!spline) return FALSE; \> \>      line = ToSpline(spline)->GetLineObject(node->GetDocument(), 1.0, NULL); \>      if(!line) \>      { \>           BaseObject::Free(spline); \>           spline = NULL; \>           return FALSE; \>      } \> \>      return TRUE; \> } \> \> void AtomObject::Free(GeListNode \*node) \> { \>      if(line) LineObject::Free(line); \>      line = NULL; \> } \> \> Bool AtomObject::Draw(BaseObject \*op, LONG drawpass, BaseDraw \*bd, BaseDrawHelp \*bh) \> { \>      if(drawpass != DRAWPASS_OBJECT) return TRUE; \> \>      return bd->DrawObject(bh, line, drawpass); \> } \> \> BaseObject \*AtomObject::GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh) \> { \>      return NULL; \> } \>

        cheers,
        Matthias

        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 18/09/2008 at 09:05, xxxxxxxx wrote:

          Thanks! That sure looks like a good tip, should be included in the SDK.

          Unfortunately, still nothing is drawn 😞

          Anyway, I guess I have done something else wrong. Will work on this some more.

          Thanks again 😉

          Greetings,
          Jack

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