u32 gf_node_get_id(GF_Node*p)
{
	NodeIDedItem *reg_node;
	GF_SceneGraph *sg;
	assert(p);
	if (!(p->sgprivate->flags & GF_NODE_IS_DEF)) return 0;
	sg = p->sgprivate->scenegraph;
#ifndef GPAC_DISABLE_VRML
	/*if this is a proto, look in parent graph*/
	if (p == (GF_Node*)sg->pOwningProto) sg = sg->parent_scene;
#endif

	reg_node = sg->id_node;
	while (reg_node) {
		if (reg_node->node==p) return reg_node->NodeID;
		reg_node = reg_node->next;
	}
	return 0;
}
u32 gf_node_get_id(GF_Node*p)
{
	NodeIDedItem *reg_node;
	GF_SceneGraph *sg;
	assert(p);
	if (!(p->sgprivate->flags & GF_NODE_IS_DEF)) return 0;
	sg = p->sgprivate->scenegraph;
#ifndef GPAC_DISABLE_VRML
	 
	if (p == (GF_Node*)sg->pOwningProto) sg = sg->parent_scene;
#endif

	reg_node = sg->id_node;
	while (reg_node) {
		if (reg_node->node==p) return reg_node->NodeID;
		reg_node = reg_node->next;
	}
	return 0;
}