void ntreeTexCheckCyclics(struct bNodeTree *ntree)
{
	bNode *node;
	for (node = ntree->nodes.first; node; node = node->next) {

		if (node->type == TEX_NODE_TEXTURE && node->id) {
			/* custom2 stops the node from rendering */
			if (node->custom1) {
				node->custom2 = 1;
				node->custom1 = 0;
			}
			else {
				Tex *tex = (Tex *)node->id;
				
				node->custom2 = 0;
			
				node->custom1 = 1;
				if (tex->use_nodes && tex->nodetree) {
					ntreeTexCheckCyclics(tex->nodetree);
				}
				node->custom1 = 0;
			}
		}

	}
}
Esempio n. 2
0
void ED_node_generic_update(Main *bmain, bNodeTree *ntree, bNode *node)
{
	bNodeTreeType *tti= ntreeGetType(ntree->type);
	NodeUpdateCalldata cd;
	cd.ntree = ntree;
	cd.node = node;
	/* look through all datablocks, to support groups */
	tti->foreach_nodetree(bmain, &cd, node_generic_update_cb);
	
	if(ntree->type == NTREE_TEXTURE)
		ntreeTexCheckCyclics(ntree);
}
Esempio n. 3
0
void ED_node_generic_update(Main *bmain, bNodeTree *ntree, bNode *node)
{
    Material *ma;
    Tex *tex;
    Scene *sce;

    /* look through all datablocks, to support groups */
    for(ma=bmain->mat.first; ma; ma=ma->id.next)
        if(ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree))
            ED_node_changed_update(&ma->id, node);

    for(tex=bmain->tex.first; tex; tex=tex->id.next)
        if(tex->nodetree && tex->use_nodes && has_nodetree(tex->nodetree, ntree))
            ED_node_changed_update(&tex->id, node);

    for(sce=bmain->scene.first; sce; sce=sce->id.next)
        if(sce->nodetree && sce->use_nodes && has_nodetree(sce->nodetree, ntree))
            ED_node_changed_update(&sce->id, node);

    if(ntree->type == NTREE_TEXTURE)
        ntreeTexCheckCyclics(ntree);
}