Draw highlight

On 12/01/2018 at 19:46, xxxxxxxx wrote:

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

---------
Hi folks,

is it possible to turn off the highlighting 'feature' when I draw a LineObject inside my ObjectData plugin's Draw() function? Currently if my object is selected the lines are drawn white.

WP.

On 15/01/2018 at 05:33, xxxxxxxx wrote:

Hi WickedP, thanks for writing us.

With reference to your request, could you please better explain your final intent? Could you also confirm that you need to draw a line using the BaseDraw::DrawLine() in ObjectData::Draw() rather than dealing with LineObject which has completely different purposes?

Best, Riccardo

On 15/01/2018 at 23:11, xxxxxxxx wrote:

Hi knickknack,

I'm wanting to draw a spline in an ObjectData's Draw() function. So I'm getting the LineObject from a SplineObject, and using DrawObject() to draw the LineObject. Psuedo code:

// set spline points
LineObject *line = Spline->GetLineObject(nullptr,0.0,nullptr)
bd->DrawObject(bh,line,DRAW_FLAGS,drawpass,nullptr,colour);
// etc..

The spline/line is drawn fine. But it's highlighted - I want the colour drawn to the colour I set regardless of whether the object is selected or not.

WP.

On 16/01/2018 at 02:26, xxxxxxxx wrote:

Hi WickedP, thankls for following up.

To avoid having your item "highlighted" simply draw it in the DRAWPASS_OBJECT rather than in the DRAWPASS_HIGHLIGHTS being sure that the pen color is set to BaseDraw::GetObjectColor() instead of BaseDraw::GetHighlightPassColor().

Best, Riccardo

On 17/01/2018 at 01:37, xxxxxxxx wrote:

Hi knickknack,

that's the thing, I'm drawing it in DRAWPASS_OBJECT and setting the pen colour isn't having any effect. It just draws the line white unless I deselect my object. This is a stripped down version of my function (psuedo to keep it minimal) :

DRAWRESULT My_Object::Draw(BaseObject *op,DRAWPASS drawpass,BaseDraw *bd,BaseDrawHelp *bh)
{
    if(drawpass == DRAWPASS_OBJECT)
    {
        // set spline points/tangents here
        // (spline is a class level variable)
        LineObject *line = My_Spline->GetLineObject(nullptr,0.0,nullptr);
  
        // this line doesn't change anything
        bd->SetPen(bd->GetObjectColor(bh,My_Spline,FALSE),NULL);
  
        Vector col = Vector(1.0,0.0,0.0);
        Draw_Result = bd->DrawObject(bh,line,DRAWOBJECT_EDITMODE|DRAWOBJECT_FORCEPOINTS|DRAWOBJECT_USE_CUSTOM_COLOR,drawpass,nullptr,col);
  
        LineObject::Free(line);
  
        if(Draw_Result == DRAWRESULT_OK)
        {
            GePrint("Drawn.");
        }
    }
  
    return SUPER::Draw(op,drawpass,bd,bh);
}

Just in addition to the highlighting issue, the DRAWOBJECT_FORCEPOINTS flag doesn't seem to do anything here. Can I draw points from the line object as well?

WP.

Edit: fixed typo.

On 16/03/2018 at 01:00, xxxxxxxx wrote:

Hi folks,

I know this is a couple of months old, but I'm having a really frustrating time with this. I've tried returning the spline in GVO instead but it does the same thing. When I add a cube and set the colour with ObjectColorProperties the cube is coloured fine. Why are splines different?

Can I colour the spline so that it's not affected by the draw highlight? There must be a way. How is the normal spline object drawn (with the white-to-blue curve colour and points)?

WP.