GF_Node *gf_node_get_parent(GF_Node *node, u32 idx)
{

	GF_ParentList *nlist = node->sgprivate->parents;
	/*break cyclic graphs*/
	if (node->sgprivate->scenegraph->RootNode==node) return NULL;
#ifndef GPAC_DISABLE_VRML
	if (node->sgprivate->scenegraph->pOwningProto && node->sgprivate->scenegraph->pOwningProto->RenderingNode==node)
		return NULL;
#endif
	if (!nlist) return NULL;
	while (idx) {
		nlist = nlist->next;
		idx--;
	}
	return nlist ? nlist->node : NULL;
}
GF_Node *gf_node_get_parent(GF_Node *node, u32 idx)
{

	GF_ParentList *nlist = node->sgprivate->parents;
	 
	if (node->sgprivate->scenegraph->RootNode==node) return NULL;
#ifndef GPAC_DISABLE_VRML
	if (node->sgprivate->scenegraph->pOwningProto && node->sgprivate->scenegraph->pOwningProto->RenderingNode==node)
		return NULL;
#endif
	if (!nlist) return NULL;
	while (idx) {
		nlist = nlist->next;
		idx--;
	}
	return nlist ? nlist->node : NULL;
}