THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2008 at 12:00, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1+
Platform: Windows ;
Language(s) : C++ ;
---------
I have questions about the following code-snippet...
//----------------------------------------------------------------------------------------------------
//******************************************************************************************************
// ObjLoader::MakeSplineObject()
//******************************************************************************************************
//------------------------------------------------------------------------------------------------------
BaseObject *ObjLoader::MakeSplineObject(DWORD numSegments, DWORD *pSegIndices, String splineName)
{
SplineObject *op;
Vector *padr;
Segment *sadr;
objSegment *pSeg;
DWORD *pSegNdx;
DWORD i, j, numVerts;
if( !numSegments ) return NULL;
// first figure out how many vertices are used...
numVerts = 0;
pSegNdx = pSegIndices;
for( i=0; i<numSegments; i++)
{
pSeg = &m_pSegs[*pSegNdx];
numVerts += pSeg->vCount;
pSegNdx++;
}
op = SplineObject::Alloc(numVerts,Tlinear); // allocate spline object large enough for all points
if( !op || !op->MakeVariableTag(Tsegment,numSegments) )
{
MessageDialog(String("Spline Object Allocation Failed"));
return NULL;
}
op->SetName(splineName);
#ifdef _R10p1_SDK_
padr = op->GetPointW();
sadr = op->GetSegmentW();
#else
padr = op->GetPoint();
sadr = op->GetSegment();
#endif
// set up the points...
numVerts = 0;
if( padr )
{
pSegNdx = pSegIndices;
for( i=0; i<numSegments; i++)
{
pSeg = &m_pSegs[*pSegNdx];
for(j=0; j<pSeg->vCount; j++)
padr[numVerts++] = m_pVerts[pSeg->v[j]];
pSegNdx++;
}
}
// set up the segments...
if (sadr)
{
pSegNdx = pSegIndices;
for( i=0; i<numSegments; i++)
{
pSeg = &m_pSegs[*pSegNdx];
sadr[i].cnt = pSeg->vCount;
sadr[i].closed = m_MpOpts.MpCloseSplines() ? true : false; // <-- this is failing
pSegNdx++;
}
}
return op;
}
...assuming that 'm_MpOpts.MpCloseSplines()' returns true (which it does), the splines are still not being 'closed'.
In the SDK, I see a SplineObject::IsClosed(void) method, but no other way to Set it to closed. Am I missing something?
Thanks,
Keith