Two bugs in one:

- Lukas commit monday for new group/socket handling accidentally removed
  to set socketype in stacks, which as used by (texture) nodes to detect
  whether value, color or vector had to be read.
  Result was that all texture nodes were rendering as B&W

- Old 2.5 bug: preview renders for texture nodes didn't call a 
  NodeEndExec function, which gave crashes on deleting nodes.

The change in interface_hanlers.c is only a comment to explain
how keymaps are being found.
This commit is contained in:
Ton Roosendaal 2011-02-26 13:53:15 +00:00
parent 457aba9d1b
commit 38bd8dcf05
3 changed files with 17 additions and 1 deletions

@ -2318,8 +2318,15 @@ void ntreeBeginExecTree(bNodeTree *ntree)
for(sock= node->inputs.first; sock; sock= sock->next) {
ns = get_socket_stack(ntree->stack, sock, NULL);
if (ns)
if (ns) {
ns->hasoutput = 1;
/* sock type is needed to detect rgba or value or vector types */
if(sock->link)
ns->sockettype= sock->link->fromsock->type;
else
sock->ns.sockettype= sock->type;
}
if(sock->link) {
bNodeLink *link= sock->link;

@ -4042,6 +4042,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
uiStyle *style= U.uistyles.first;
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
/* XXX this guess_opname can potentially return a different keymap than being found on adding later... */
km = WM_keymap_guess_opname(C, but->optype->idname);
kmi = WM_keymap_add_item(km, but->optype->idname, AKEY, KM_PRESS, 0, 0);

@ -1055,6 +1055,14 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
/* unassign the pointers, reset vars */
preview_prepare_scene(sp->scene, NULL, GS(id->name), sp);
/* XXX bad exception, end-exec is not being called in render, because it uses local main */
if(idtype == ID_TE) {
Tex *tex= (Tex *)id;
if(tex->use_nodes && tex->nodetree)
ntreeEndExecTree(tex->nodetree);
}
}
/* runs inside thread for material and icons */