GF_Err gf_node_remove_id(GF_Node *p)
{
	GF_SceneGraph *pSG;
	if (!p) return GF_BAD_PARAM;

	pSG = p->sgprivate->scenegraph;
#ifndef GPAC_DISABLE_VRML
	/*if this is a proto register to the parent graph, not the current*/
	if (p == (GF_Node*)pSG->pOwningProto) pSG = pSG->parent_scene;
#endif

	/*new DEF ID*/
	if (p->sgprivate->flags & GF_NODE_IS_DEF) {
		remove_node_id(pSG, p);
		p->sgprivate->flags &= ~GF_NODE_IS_DEF;
		return GF_OK;
	}
	return GF_BAD_PARAM;
}
GF_Err gf_node_remove_id(GF_Node *p)
{
	GF_SceneGraph *pSG;
	if (!p) return GF_BAD_PARAM;

	pSG = p->sgprivate->scenegraph;
#ifndef GPAC_DISABLE_VRML
	 
	if (p == (GF_Node*)pSG->pOwningProto) pSG = pSG->parent_scene;
#endif

	 
	if (p->sgprivate->flags & GF_NODE_IS_DEF) {
		remove_node_id(pSG, p);
		p->sgprivate->flags &= ~GF_NODE_IS_DEF;
		return GF_OK;
	}
	return GF_BAD_PARAM;
}