Ejemplo n.º 1
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);
}
Ejemplo n.º 2
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;
}
Ejemplo n.º 3
0
void EditPolyMod::EpModSetPrimaryNode (INode *inode)
{
	if (!ip) return;

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

	for (int i=0; i<list.Count(); i++)
	{
		if (list[i]->localData == NULL) continue;
		EditPolyData *pdat = (EditPolyData *) list[i]->localData;
		if (!inode) inode = nodes[i]->GetActualINode();	// Pick the first one, if we're called with NULL.
		if (nodes[i]->GetActualINode() == inode) pdat->SetFlag (kEPDataPrimary);
		else pdat->ClearFlag (kEPDataPrimary);
	}
}
Ejemplo n.º 4
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;
}