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

    Draw anything?

    SDK Help
    0
    9
    2.3k
    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 11/11/2002 at 09:49, xxxxxxxx wrote:

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

      ---------
      I want to draw for example a circle in the Draw Method of my ToolPlugin. I am trying to use
      bd->SetPen(Vector(200,0,0));
      bd->Circle2D(40,40,10);
      but that doesn´t seem to work at all. Do I need anything else? (or is there a way to draw a circle with XORLines without using "a thousand" commands to draw?)
      Thanks

      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 11/11/2002 at 11:01, xxxxxxxx wrote:

        Quote: Originally posted by 3D Designer on 11  November 2002
        >
        > * * *
        >
        > I want to draw for example a circle in the Draw Method of my ToolPlugin. I am trying to use
        >
        > bd->SetPen(Vector(200,0,0));
        > bd->Circle2D(40,40,10);
        >
        > but that doesn´t seem to work at all. Do I need anything else? (or is there a way to draw a circle with XORLines without using "a thousand" commands to draw?)
        Your code works fine for me. It draws a red circle. (Btw, the color components should be between 0 and 1.) Could you post some more source?

        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 11/11/2002 at 11:19, xxxxxxxx wrote:

          Hi, thats all I got in the draw method. I am also returning DRAW_HANDLES|DRAW_AXIS at the end.
          bd->SetPen(Vector(200,0,0));
          bd->Circle2D(40,40,10);
          return DRAW_HANDLES|DRAW_AXIS;
          Any idea? 😕

          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 11/11/2002 at 11:29, xxxxxxxx wrote:

            Quote: Originally posted by 3D Designer on 11  November 2002
            >
            > * * *
            >
            > Any idea? :
            No, that's what I have too. Do you have anything selected in the scene? Please try it with an empty scene and see if the result is the same. Also, please remove other functions from your tool plugin or post the entire plugin. (To rule out other factors.)
            Does it matter which drawing functions you use? Does the 3D ones work better? (E.g. Circle3D.)

            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 11/11/2002 at 12:47, xxxxxxxx wrote:

              yes an object is selected. But deselecting everything doesn´t help.
              I have removed anything but the draw function and it still doesn´t work. Circle3D doesn´t work either. 😞
              This is the code without any other functions:
              #include "c4d_toolplugin.h"
              #include "c4d_basedraw.h"
              #define TEST_ID 1111111
              class LiquidToolData : public ToolData
              {
               public:
                  virtual Bool   Draw(BaseDocument *doc,BaseObject *actu_op, BaseDraw
              };
              Bool LiquidToolData::Draw(BaseDocument *doc,BaseObject *actu_op, BaseDraw *bd, BaseDrawHelp *bh, BaseThread *bt,LONG flags)
              {

              bd->SetPen(Vector(1,0,0));
               bd->Circle2D(40,40,10);
               return DRAW_HANDLES|DRAW_AXIS;
               
              }
              Bool RegisterPrimitiveTool(void)
              {
                String name="Test";
               return RegisterToolPlugin(TEST_ID,name,0,"test.tif","Test",gNew LiquidToolData);
              }
              It still doesn´t work 😕

              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 11/11/2002 at 12:56, xxxxxxxx wrote:

                AHHHHHHHHH, I guess i got it. I still got the R7 Draw function in there BaseObject *actu_op and the return Value is Bool.
                I will try changing it to the R8 method would be a good start I guess 🙂
                I will try it
                Samir

                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 11/11/2002 at 12:57, xxxxxxxx wrote:

                  Hihi, yes that was the problem. The draw function never worked. 🙂
                  Da**. I really thought I was too stupid (well actually I was 🙂
                  Thanks for your patience!
                  Best
                  SAmir

                  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 11/11/2002 at 13:23, xxxxxxxx wrote:

                    Quote: Originally posted by 3D Designer on 11  November 2002
                    >
                    > * * *
                    >
                    > Bool LiquidToolData::Draw(BaseDocument *doc,BaseObject *actu_op, BaseDraw *bd, BaseDrawHelp *bh, BaseThread *bt,LONG flags)
                    > {
                    >   bd->SetPen(Vector(1,0,0));
                    >   bd->Circle2D(40,40,10);
                    >   return DRAW_HANDLES|DRAW_AXIS;
                    > }
                    This is the wrong signature! Your function is never called, since it doesn't have the same parameters as the one you want to overload in ToolData. Strangely enough there's no compiler warning for this in MSVC. Change it to the following to make it work:

                        
                        
                        virtual LONG Draw(BaseDocument *doc, BaseContainer &data, BaseDraw *bd, BaseDrawHelp *bh, BaseThread *bt,LONG flags)  
                        {  
                         bd->SetPen(Vector(1,0,0));  
                         bd->Circle2D(40,40,10);  
                         return DRAW_HANDLES|DRAW_AXIS;   
                        }
                    
                    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 11/11/2002 at 13:57, xxxxxxxx wrote:

                      yep, thanks it works fine now.

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