THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/03/2007 at 16:33, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I can't get the phong break working in my virtual polygon object.
First I tried to select the appropriate edges and then use SendModellingCommand(MCOMMAND_BREAKPHONG, md). No effect. If I make the object editable, I can see, that the right edges are selected. If I use another ModellingCommand like the Bevel tool, that works.
Then I tried GetPhongBreak() and write the edge selection into that baseselect. No effect.
I select the edges using bs->Select(polyIndex*4 + edgeIndex).
Can anyone please help? Isn't it possible at all to make a phong break in a virtual polygon object?
Here the code snippet:
BaseSelect *bs = pp->GetPhongBreak();
Neighbor nb;
PolyInfo *pli;
if (!nb.Init(pcnt, vAdr, vcnt, NULL))
return FALSE;
for (i=0; i<vcnt; i++)
{
pli = nb.GetPolyInfo(i);
for (j=0; j<4; j++)
{
if ((pli->face[j] == NOTOK) || (pli->mark[j]))
continue;
switch (j)
{
case 0: a=vAdr _.a; b=vAdr _.b; break;
case 1: a=vAdr _.b; b=vAdr _.c; break;
case 2: a=vAdr _.c; b=vAdr _.d; break;
case 3: a=vAdr _.d; b=vAdr _.a; break;
}
p1 = pAdr[a] * m;
p2 = pAdr *** m;
for (l=0; l<k; l+=2)
{
p = pVert[l];
v = pVert[l+1];
if ((Len(PointLineDistance(p, v, p1)) <= tol) && (Len(PointLineDistance(p, v, p2)) <= tol))
{
bs->Select(i*4+j);
ecnt++;
break;
}
}
}
}