THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/07/2008 at 11:17, xxxxxxxx wrote:
Yes, you have to override the function and do the drawing with help of the BaseDraw instance provided. Unfortunately, I have no idea how the GvOperatorData::SceneDraw() works. If you continue to get no calls to the method, Matthias may need to chime in. GvNodeMaster::AddToDrawList() looks interesting but not much detail on how that works in conjunction with SceneDraw().
Here's the override for one of my plugin objects:
// ObjectData.Draw
//*---------------------------------------------------------------------------*
Bool IPPBase::Draw(PluginObject* op, LONG drawpass, BaseDraw* bd, BaseDrawHelp* bh)
//*---------------------------------------------------------------------------*
{
if (!(op && bd && bh)) return TRUE;
// Draw 'Bone' in general
if (drawpass == DRAWPASS_OBJECT)
{
bbc = op->GetDataInstance();
if (!bbc) return TRUE;
// Draw Bone or not
if (!bbc->GetBool(IPP_SHOWBONE)) return TRUE;
BaseDocument* doc = op->GetDocument();
if (!doc) return TRUE;
root = bbc->GetObjectLink(IPP_ROOT, doc);
if (!root) return TRUE;
// Show Root bones differently
if (bbc->GetBool(IPP_ISROOT) || root->GetTag(ID_IPPOBJECTTAG))
{
Matrix mg = bh->GetMg();
bd->SetPen(Vector(1.0f,1.0f,0.0f));
mg.v1 = Vector(epBBlen,0.0f,0.0f);
mg.v2 = Vector(0.0f,epBBlen,0.0f);
bd->Circle3D(mg);
mg.v1 = Vector(0.0f,0.0f,epBBlen);
mg.v2 = Vector(0.0f,epBBlen,0.0f);
bd->Circle3D(mg);
mg.v1 = Vector(epBBlen,0.0f,0.0f);
mg.v2 = Vector(0.0f,0.0f,epBBlen);
bd->Circle3D(mg);
}
else
{
// To avoid origin clipping of entire draw using: bd->DrawPolygonObject(bh, boneObj, DRAWPOLYOBJECT_LOCALMATRIX);
boneObj->SetMg(bh->GetMg());
boneObj->Message(MSG_UPDATE);
bd->DrawPolygonObject(bh, boneObj, 0L);
}
}
// Draw Basic Data when selected
else if (drawpass == DRAWPASS_HANDLES)
{
bbc = op->GetDataInstance();
if (!bbc) return TRUE;
// Origin-EndPoint
Matrix mg = bh->GetMg();
// Origin cross-hairs
bd->SetPen(Vector(0.0f,1.0f,0.0f));
bd->Line3D(Vector(-lenBB, 0.0f, 0.0f)*mg, Vector(lenBB, 0.0f, 0.0f)*mg);
bd->Line3D(Vector(0.0f, -lenBB, 0.0f)*mg, Vector(0.0f, lenBB, 0.0f)*mg);
bd->Line3D(Vector(0.0f, 0.0f, -lenBB)*mg, Vector(0.0f, 0.0f, lenBB)*mg);
// Line between Origin-EndPoint
bd->SetPen(Vector(1.0f,1.0f,0.0f));
bd->Line3D(Vector(0.0f,0.0f,0.0f)*mg, epBB*mg);
// EndPoint cross-hairs
bd->SetPen(Vector(1.0f,0.0f,0.0f));
bd->Line3D(Vector(epBB.x-lenBB, epBB.y, epBB.z)*mg, Vector(epBB.x+lenBB, epBB.y, epBB.z)*mg);
bd->Line3D(Vector(epBB.x, epBB.y-lenBB, epBB.z)*mg, Vector(epBB.x, epBB.y+lenBB, epBB.z)*mg);
bd->Line3D(Vector(epBB.x, epBB.y, epBB.z-lenBB)*mg, Vector(epBB.x, epBB.y, epBB.z+lenBB)*mg);
}
return SUPER::Draw(op, drawpass, bd, bh);
}