THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/08/2012 at 17:12, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hey gang.
Here's one I haven't seen addressed yet.
How the heck do we create our own custom handle shapes?
There's a flag called DRAWHANDLE_CUSTOM in the SDK. But absolutely no mention on how to actually use it.
I've been playing around with the DoubleCircle example in the SDK. And I've been able to add things like lines and highlight color changing by adding a Draw() method to it:
DRAWRESULT DoubleCircleData::Draw(BaseObject *op, DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh)
{
LONG hitid, i;
Matrix mx;
HandleInfo info;
if(drawpass != DRAWPASS_HANDLES) //Only draw the handles in this plugin
return DRAWRESULT_SKIP;
hitid = op->GetHighlightHandle(bd); //Check if the user is hovering over the handle
bd->SetMatrix_Matrix(op, bh->GetMg()); //Converts coordinates into global space
bd->SetPen(GetViewColor(VIEWCOLOR_ACTIVEPOINT)); //Sets the color of the handle to this color
for(i = 0; i < HANDLES; i++)
{
if(i == hitid) //If the handle is hit
bd->SetPen(GetViewColor(VIEWCOLOR_SELECTION_PREVIEW)); //Draw it in a different color so we can tell it's been hit
GetHandle(op, i, info); //Get the handle's info from the GetHandle function
bd->DrawHandle(info.position, DRAWHANDLE_BIG, 0); //Use the info to create a big ball type looking handle
}
//We only have handles at this point...This next code draws the lines
GetHandle(op, 0, info); //Get the first handle and it's info
bd->DrawLine(info.position, Vector(0.0), 0); //Draws a line from the center of the object to the handle
GetHandle(op, 1, info); //Get the second handle and it's info
bd->DrawLine(info.position, Vector(0.0), 0); //Draws a line from the center of the object to the handle
return DRAWRESULT_OK;
}
It would be very cool If I could replace DRAWHANDLE_BIG with DRAWHANDLE_CUSTOM.
But the SDK never tells us what it requires.
-ScottA