Three-fixes-in-one:

#5417: Only Shadow material gave shadow outside of Spot bundle
#5414: Material Nodes: sockets without input were always treated as single
       value inputs, ignoring color or vector. (Caused by commit to do
       automatic conversions of socket links).
#5420: When reading with old Blender a new file that has a new window type,
       saving it over, and read back in current Blender, the window type
       should be reset to EMPTY, because all its data got lost.
This commit is contained in:
Ton Roosendaal
2006-12-12 11:13:43 +00:00
parent 09e4fa8f6a
commit 4595bef2b4
3 changed files with 17 additions and 5 deletions

View File

@@ -1802,6 +1802,8 @@ static void group_tag_used_outputs(bNode *gnode, bNodeStack *stack)
ns->hasoutput= 1;
ns->sockettype= sock->link->fromsock->type;
}
else
sock->ns.sockettype= sock->type;
}
}
}
@@ -1846,6 +1848,8 @@ void ntreeBeginExecTree(bNodeTree *ntree)
ns->hasoutput= 1;
ns->sockettype= sock->link->fromsock->type;
}
else
sock->ns.sockettype= sock->type;
}
if(node->type==NODE_GROUP && node->id)
group_tag_used_outputs(node, ntree->stack[0]);

View File

@@ -3678,12 +3678,16 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
link_list(fd, &(sa->spacedata));
link_list(fd, &(sa->panels));
/* accident can happen when read/save new file with older version */
if(sa->spacedata.first==NULL)
sa->spacetype= SPACE_EMPTY;
for(pa= sa->panels.first; pa; pa=pa->next) {
pa->paneltab= newdataadr(fd, pa->paneltab);
pa->active= 0;
pa->sortcounter= 0;
}
for (sl= sa->spacedata.first; sl; sl= sl->next) {
if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;

View File

@@ -1373,22 +1373,26 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
visifac= lamp_get_visibility(lar, shi->co, lv, &lampdist);
if(visifac < 0.0f)
if(visifac <= 0.0f) {
ir+= 1.0f;
accum+= 1.0f;
continue;
}
inpr= INPR(shi->vn, lv);
if(inpr <= 0.0f)
continue;
lamp_get_shadow(lar, shi, inpr, shadfac, shi->depth);
ir+= 1.0f;
accum+= shadfac[3];
accum+= (1.0f-visifac) + (visifac)*shadfac[3];
}
}
if(ir>0.0f) {
accum/= ir;
shr->alpha= (shi->alpha)*(1.0f-accum);
shr->alpha= (shi->mat->alpha)*(1.0f-accum);
}
else shr->alpha= shi->mat->alpha;
}
/* quite disputable this... also note it doesn't mirror-raytrace */