예제 #1
0
LocalModData *EditPolyMod::GetPrimaryLocalModData ()
{
	if (!ip) return NULL;

	ModContextList list;
	INodeTab nodes;	
	ip->GetModContexts(list,nodes);

	for (int i=0; i<list.Count(); i++)
	{
		if (list[i]->localData == NULL) continue;
		EditPolyData *pData = (EditPolyData *) list[i]->localData;
		if (pData->GetFlag (kEPDataPrimary)) return pData;
	}
	// No primary? Ok, return first mesh we get to (and make it primary).
	for (int i=0; i<list.Count(); i++)
	{
		if (list[i]->localData == NULL) continue;
		EditPolyData *pData = (EditPolyData *) list[i]->localData;
		pData->SetFlag (kEPDataPrimary);
		return pData;
	}

	return NULL;
}
예제 #2
0
Matrix3 EditPolyMod::EpModGetNodeTM (TimeValue t, INode *node)
{
	if (node) return node->GetObjectTM (t);

	if (!ip) return Matrix3(true);

	ModContextList list;
	INodeTab nodes;	
	ip->GetModContexts(list,nodes);

	for (int i=0; i<list.Count(); i++)
	{
		if (list[i]->localData == NULL) continue;
		EditPolyData *pData = (EditPolyData *) list[i]->localData;
		if (pData->GetFlag (kEPDataPrimary)) return nodes[i]->GetObjectTM (t);
	}

	// No primary? Ok, return first node we get to (and set it to primary):
	for (int i=0; i<list.Count(); i++)
	{
		if (list[i]->localData == NULL) continue;
		EditPolyData *pData = (EditPolyData *) list[i]->localData;
		pData->SetFlag (kEPDataPrimary);
		return nodes[i]->GetObjectTM (t);
	}

	return Matrix3(true);
}
예제 #3
0
INode *EditPolyMod::EpModGetPrimaryNode ()
{
	if (!ip) return NULL;

	ModContextList list;
	INodeTab nodes;	
	ip->GetModContexts(list,nodes);

	INode *ret = NULL;
	for (int i=0; i<list.Count(); i++)
	{
		if (list[i]->localData == NULL) continue;
		EditPolyData *pData = (EditPolyData *) list[i]->localData;
		if (pData->GetFlag (kEPDataPrimary))
		{
			ret = nodes[i];
			break;
		}
	}

	if (!ret) {
		// No primary? Ok, return first one we get to (and make it primary).
		for (int i=0; i<list.Count(); i++)
		{
			if (list[i]->localData == NULL) continue;
			EditPolyData *pData = (EditPolyData *) list[i]->localData;
			pData->SetFlag (kEPDataPrimary);
			ret = nodes[i];
			break;
		}
	}

	if (ret) ret = ret->GetActualINode ();
	nodes.DisposeTemporary();

	return ret;
}