THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/09/2003 at 16:51, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.207
Platform: Windows ;
Language(s) : C++ ;
---------
I have some handles for my object plugin but I ran into a problem. When using the handles to control a Real field with Meter or no "units" then it works perfectly but when using it for a field that has percentage units its range is too wide. Means when moving the handle 100 units then I want the percentage field to be at 100% but it´s at 10000%.
ok, so this seems to be a simple task, just divide the resulting value with 100 and it should work. But it´s not. Then the handle is placed wrong again :
So, can somebody help me out here. Where or how to get the correct behavior (or where to divide...)
Heres a code snippet (using a vector field, x component) :
Bool DPDub::MoveHandle(PluginObject *op, PluginObject *undo, const Matrix &tm, LONG hit_id, LONG qualifier)
{
BaseContainer *src = undo->GetDataInstance();
BaseContainer *dst = op->GetDataInstance();
Vector vval = tm.off;
Vector rot = src->GetVector(DBDUB_SCA);
switch (hit_id)
{
case 4:
vval.x+=src->GetVector(DBDUB_SCA).x+vval.x*0.001;
dst->SetVector(DBDUB_SCA,Vector(FCut(vval.x,0,10000),rot.y,rot.z));
break;
}
DrawViews(DA_NO_THREAD|DA_ONLY_ACTIVE_VIEW);
return TRUE;
Thanks