Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/BKE_material.h2
-rw-r--r--source/blender/blenkernel/BKE_node.h1
-rw-r--r--source/blender/blenkernel/intern/material.c41
-rw-r--r--source/blender/blenkernel/intern/node_composite.c93
-rw-r--r--source/blender/blenkernel/intern/node_shaders.c35
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/include/butspace.h1
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h1
-rw-r--r--source/blender/makesdna/DNA_node_types.h3
-rw-r--r--source/blender/makesdna/DNA_object_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h4
-rw-r--r--source/blender/render/extern/include/RE_shader_ext.h56
-rw-r--r--source/blender/src/buttons_object.c2
-rw-r--r--source/blender/src/buttons_scene.c80
-rw-r--r--source/blender/src/drawnode.c34
-rw-r--r--source/blender/src/editnode.c15
17 files changed, 240 insertions, 135 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 298ed5ff025..71ede8820db 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -44,7 +44,7 @@ struct ListBase;
struct MemFile;
#define BLENDER_VERSION 242
-#define BLENDER_SUBVERSION 1
+#define BLENDER_SUBVERSION 2
#define BLENDER_MINVERSION 240
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index a9609f88c98..93260bac73d 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -53,7 +53,7 @@ void make_local_material(struct Material *ma);
struct Material ***give_matarar(struct Object *ob);
short *give_totcolp(struct Object *ob);
struct Material *give_current_material(struct Object *ob, int act);
-ID *material_from(struct Object *ob, int act);
+struct ID *material_from(struct Object *ob, int act);
void assign_material(struct Object *ob, struct Material *ma, int act);
void new_material_to_objectdata(struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 94884caaa25..88f35113dac 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -270,6 +270,7 @@ struct CompBuf;
void ntreeCompositTagRender(struct bNodeTree *ntree);
void ntreeCompositTagAnimated(struct bNodeTree *ntree);
void ntreeCompositTagGenerators(struct bNodeTree *ntree);
+void ntreeCompositForceHidden(struct bNodeTree *ntree);
void free_compbuf(struct CompBuf *cbuf); /* internal...*/
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index e54f44075fb..1bcea5a6e42 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -574,7 +574,7 @@ void new_material_to_objectdata(Object *ob)
ob->actcol= ob->totcol;
}
-static void do_init_render_material(Material *ma, int osa, float *amb)
+static void do_init_render_material(Material *ma, int r_mode, float *amb)
{
MTex *mtex;
int a, needuv=0;
@@ -590,11 +590,11 @@ static void do_init_render_material(Material *ma, int osa, float *amb)
if(ma->septex & (1<<a)) continue;
mtex= ma->mtex[a];
- if(mtex && mtex->tex) {
+ if(mtex && mtex->tex && mtex->tex->type) {
ma->texco |= mtex->texco;
ma->mapto |= mtex->mapto;
- if(osa) {
+ if(r_mode & R_OSA) {
if ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP) ma->texco |= TEXCO_OSA;
}
@@ -604,20 +604,23 @@ static void do_init_render_material(Material *ma, int osa, float *amb)
}
}
- if(ma->mode & MA_RADIO) needuv= 1;
+ if(r_mode & R_RADIO)
+ if(ma->mode & MA_RADIO) needuv= 1;
if(ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) {
needuv= 1;
- if(osa) ma->texco |= TEXCO_OSA; /* for texfaces */
+ if(r_mode & R_OSA) ma->texco |= TEXCO_OSA; /* for texfaces */
}
if(needuv) ma->texco |= NEED_UV;
- // since the raytracer doesnt recalc O structs for each ray, we have to preset them all
- if(ma->mode & (MA_RAYMIRROR|MA_RAYTRANSP|MA_SHADOW_TRA)) {
- ma->texco |= NEED_UV|TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM;
- if(osa) ma->texco |= TEXCO_OSA;
+ /* since the raytracer doesnt recalc O structs for each ray, we have to preset them all */
+ if(r_mode & R_RAYTRACE) {
+ if(ma->mode & (MA_RAYMIRROR|MA_RAYTRANSP|MA_SHADOW_TRA)) {
+ ma->texco |= NEED_UV|TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM;
+ if(r_mode & R_OSA) ma->texco |= TEXCO_OSA;
+ }
}
-
+
if(amb) {
ma->ambr= ma->amb*amb[0];
ma->ambg= ma->amb*amb[1];
@@ -627,7 +630,7 @@ static void do_init_render_material(Material *ma, int osa, float *amb)
ma->mode_l= ma->mode;
}
-static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int osa, float *amb)
+static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode, float *amb)
{
bNode *node;
@@ -636,32 +639,32 @@ static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int osa, f
if(GS(node->id->name)==ID_MA) {
Material *ma= (Material *)node->id;
if(ma!=basemat) {
- do_init_render_material(ma, osa, amb);
+ do_init_render_material(ma, r_mode, amb);
basemat->texco |= ma->texco;
basemat->mode_l |= ma->mode_l;
}
}
else if(node->type==NODE_GROUP)
- init_render_nodetree((bNodeTree *)node->id, basemat, osa, amb);
+ init_render_nodetree((bNodeTree *)node->id, basemat, r_mode, amb);
}
}
/* parses the geom+tex nodes */
- basemat->texco |= ntreeShaderGetTexco(ntree, osa);
+ basemat->texco |= ntreeShaderGetTexco(ntree, r_mode);
}
-void init_render_material(Material *mat, int osa, float *amb)
+void init_render_material(Material *mat, int r_mode, float *amb)
{
- do_init_render_material(mat, osa, amb);
+ do_init_render_material(mat, r_mode, amb);
if(mat->nodetree && mat->use_nodes) {
- init_render_nodetree(mat->nodetree, mat, osa, amb);
+ init_render_nodetree(mat->nodetree, mat, r_mode, amb);
ntreeBeginExecTree(mat->nodetree); /* has internal flag to detect it only does it once */
}
}
-void init_render_materials(int osa, float *amb)
+void init_render_materials(int r_mode, float *amb)
{
Material *ma;
@@ -670,7 +673,7 @@ void init_render_materials(int osa, float *amb)
/* is_used flag comes back in convertblender.c */
ma->flag &= ~MA_IS_USED;
if(ma->id.us)
- init_render_material(ma, osa, amb);
+ init_render_material(ma, r_mode, amb);
}
}
diff --git a/source/blender/blenkernel/intern/node_composite.c b/source/blender/blenkernel/intern/node_composite.c
index 6050b1c98ba..ed43cf2d808 100644
--- a/source/blender/blenkernel/intern/node_composite.c
+++ b/source/blender/blenkernel/intern/node_composite.c
@@ -1053,14 +1053,16 @@ static bNodeType cmp_node_image= {
#define RRES_OUT_IMAGE 0
#define RRES_OUT_ALPHA 1
#define RRES_OUT_Z 2
-#define RRES_OUT_NOR 3
+#define RRES_OUT_NORMAL 3
#define RRES_OUT_VEC 4
-#define RRES_OUT_COL 5
+#define RRES_OUT_RGBA 5
#define RRES_OUT_DIFF 6
#define RRES_OUT_SPEC 7
-#define RRES_OUT_SHAD 8
+#define RRES_OUT_SHADOW 8
#define RRES_OUT_AO 9
-#define RRES_OUT_RAY 10
+#define RRES_OUT_REFLECT 10
+#define RRES_OUT_REFRACT 11
+#define RRES_OUT_INDEXOB 12
static bNodeSocketType cmp_node_rlayers_out[]= {
{ SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
@@ -1068,12 +1070,14 @@ static bNodeSocketType cmp_node_rlayers_out[]= {
{ SOCK_VALUE, 0, "Z", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_VECTOR, 0, "Normal", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_VECTOR, 0, "Speed", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-// { SOCK_RGBA, 0, "Color", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-// { SOCK_RGBA, 0, "Diffuse", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-// { SOCK_RGBA, 0, "Specular", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-// { SOCK_RGBA, 0, "Shadow", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-// { SOCK_RGBA, 0, "AO", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-// { SOCK_RGBA, 0, "Ray", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "Color", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "Diffuse", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "Specular", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "Shadow", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "AO", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "Reflect", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_RGBA, 0, "Refract", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_VALUE, 0, "IndexOB", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ -1, 0, "" }
};
@@ -1085,7 +1089,7 @@ static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, in
CompBuf *buf;
int buftype= CB_VEC3;
- if(passcode==SCE_PASS_Z)
+ if(ELEM(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB))
buftype= CB_VAL;
else if(passcode==SCE_PASS_VECTOR)
buftype= CB_VEC4;
@@ -1141,22 +1145,26 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in,
out[RRES_OUT_Z]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_Z);
if(out[RRES_OUT_VEC]->hasoutput)
out[RRES_OUT_VEC]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_VECTOR);
- if(out[RRES_OUT_NOR]->hasoutput)
- out[RRES_OUT_NOR]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_NORMAL);
- /*
- if(out[RRES_OUT_COL]->hasoutput)
- out[RRES_OUT_COL]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_RGBA);
+ if(out[RRES_OUT_NORMAL]->hasoutput)
+ out[RRES_OUT_NORMAL]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_NORMAL);
+
+ if(out[RRES_OUT_RGBA]->hasoutput)
+ out[RRES_OUT_RGBA]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_RGBA);
if(out[RRES_OUT_DIFF]->hasoutput)
out[RRES_OUT_DIFF]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_DIFFUSE);
if(out[RRES_OUT_SPEC]->hasoutput)
out[RRES_OUT_SPEC]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_SPEC);
- if(out[RRES_OUT_SHAD]->hasoutput)
- out[RRES_OUT_SHAD]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_SHADOW);
+ if(out[RRES_OUT_SHADOW]->hasoutput)
+ out[RRES_OUT_SHADOW]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_SHADOW);
if(out[RRES_OUT_AO]->hasoutput)
out[RRES_OUT_AO]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_AO);
- if(out[RRES_OUT_RAY]->hasoutput)
- out[RRES_OUT_RAY]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_RAY);
- */
+ if(out[RRES_OUT_REFLECT]->hasoutput)
+ out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_REFLECT);
+ if(out[RRES_OUT_REFRACT]->hasoutput)
+ out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_REFRACT);
+ if(out[RRES_OUT_INDEXOB]->hasoutput)
+ out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rr->rectx, rr->recty, SCE_PASS_INDEXOB);
+
generate_preview(node, stackbuf);
}
}
@@ -4384,6 +4392,49 @@ bNodeType *node_all_composit[]= {
/* ******************* parse ************ */
+/* based on rules, force sockets hidden always */
+void ntreeCompositForceHidden(bNodeTree *ntree)
+{
+ bNode *node;
+
+ if(ntree==NULL) return;
+
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if( node->type==CMP_NODE_R_LAYERS) {
+ Scene *sce= node->id?(Scene *)node->id:G.scene; /* G.scene is WEAK! */
+ SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
+ if(srl) {
+ bNodeSocket *sock;
+ for(sock= node->outputs.first; sock; sock= sock->next)
+ sock->flag &= ~SOCK_UNAVAIL;
+
+ sock= BLI_findlink(&node->outputs, RRES_OUT_Z);
+ if(!(srl->passflag & SCE_PASS_Z)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_NORMAL);
+ if(!(srl->passflag & SCE_PASS_NORMAL)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_VEC);
+ if(!(srl->passflag & SCE_PASS_VECTOR)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_RGBA);
+ if(!(srl->passflag & SCE_PASS_RGBA)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_DIFF);
+ if(!(srl->passflag & SCE_PASS_DIFFUSE)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_SPEC);
+ if(!(srl->passflag & SCE_PASS_SPEC)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_SHADOW);
+ if(!(srl->passflag & SCE_PASS_SHADOW)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_AO);
+ if(!(srl->passflag & SCE_PASS_AO)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_REFLECT);
+ if(!(srl->passflag & SCE_PASS_REFLECT)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_REFRACT);
+ if(!(srl->passflag & SCE_PASS_REFRACT)) sock->flag |= SOCK_UNAVAIL;
+ sock= BLI_findlink(&node->outputs, RRES_OUT_INDEXOB);
+ if(!(srl->passflag & SCE_PASS_INDEXOB)) sock->flag |= SOCK_UNAVAIL;
+ }
+ }
+ }
+
+}
/* called from render pipeline, to tag render input and output */
void ntreeCompositTagRender(bNodeTree *ntree)
diff --git a/source/blender/blenkernel/intern/node_shaders.c b/source/blender/blenkernel/intern/node_shaders.c
index e3710dfbaf7..49c3c4eff59 100644
--- a/source/blender/blenkernel/intern/node_shaders.c
+++ b/source/blender/blenkernel/intern/node_shaders.c
@@ -34,6 +34,7 @@
#include "DNA_ID.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
+#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "BKE_blender.h"
@@ -54,8 +55,8 @@
/* ********* exec data struct, remains internal *********** */
typedef struct ShaderCallData {
- ShadeInput *shi;
- ShadeResult *shr;
+ ShadeInput *shi; /* from render pipe */
+ ShadeResult *shr; /* from render pipe */
} ShaderCallData;
@@ -103,9 +104,7 @@ static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bN
if(node->flag & NODE_DO_OUTPUT) {
ShadeResult *shr= ((ShaderCallData *)data)->shr;
- VECCOPY(shr->diff, col);
- col[0]= col[1]= col[2]= 0.0f;
- VECCOPY(shr->spec, col);
+ QUATCOPY(shr->combined, col);
shr->alpha= col[3];
// VECCOPY(shr->nor, in[3]->vec);
@@ -223,9 +222,10 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
if(data && node->id) {
ShadeResult shrnode;
ShadeInput *shi;
+ ShaderCallData *shcd= data;
float col[4], *nor;
- shi= ((ShaderCallData *)data)->shi;
+ shi= shcd->shi;
shi->mat= (Material *)node->id;
/* copy all relevant material vars, note, keep this synced with render_types.h */
@@ -264,9 +264,9 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
/* write to outputs */
if(node->custom1 & SH_NODE_MAT_DIFF) {
- VECCOPY(col, shrnode.diff);
- if(node->custom1 & SH_NODE_MAT_SPEC) {
- VecAddf(col, col, shrnode.spec);
+ VECCOPY(col, shrnode.combined);
+ if(!(node->custom1 & SH_NODE_MAT_SPEC)) {
+ VecSubf(col, col, shrnode.spec);
}
}
else if(node->custom1 & SH_NODE_MAT_SPEC) {
@@ -291,6 +291,9 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
VECCOPY(out[MAT_OUT_NORMAL]->vec, shi->vn);
+ /* copy passes, now just active node */
+ if(node->flag & NODE_ACTIVE)
+ *(shcd->shr)= shrnode;
}
}
@@ -1029,11 +1032,21 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
scd.shr= shr;
ntreeExecTree(ntree, &scd, shi->thread); /* threads */
+
+ /* better not allow negative for now */
+ if(shr->spec[0]<0.0f) shr->spec[0]= 0.0f;
+ if(shr->spec[1]<0.0f) shr->spec[1]= 0.0f;
+ if(shr->spec[2]<0.0f) shr->spec[2]= 0.0f;
+
+ if(shr->combined[0]<0.0f) shr->combined[0]= 0.0f;
+ if(shr->combined[1]<0.0f) shr->combined[1]= 0.0f;
+ if(shr->combined[2]<0.0f) shr->combined[2]= 0.0f;
+
}
/* go over all used Geometry and Texture nodes, and return a texco flag */
/* no group inside needed, this function is called for groups too */
-int ntreeShaderGetTexco(bNodeTree *ntree, int osa)
+int ntreeShaderGetTexco(bNodeTree *ntree, int r_mode)
{
bNode *node;
bNodeSocket *sock;
@@ -1043,7 +1056,7 @@ int ntreeShaderGetTexco(bNodeTree *ntree, int osa)
for(node= ntree->nodes.first; node; node= node->next) {
if(node->type==SH_NODE_TEXTURE) {
- if(osa && node->id) {
+ if((r_mode & R_OSA) && node->id) {
Tex *tex= (Tex *)node->id;
if ELEM3(tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)
texco |= TEXCO_OSA|NEED_UV;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a61e254c533..6d41ffcdcd3 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6039,7 +6039,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
BezTriple *bezt;
BPoint *bp;
int a;
-
+
for(sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
sa= sc->areabase.first;
@@ -6164,7 +6164,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* now, subversion control! */
if(main->subversionfile < 1) {
-
}
}
diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h
index 44432c4a3eb..a3abf3b8acf 100644
--- a/source/blender/include/butspace.h
+++ b/source/blender/include/butspace.h
@@ -338,6 +338,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
#define B_SET_EDGE 1643
#define B_SET_ZBLUR 1644
#define B_ADD_RENDERLAYER 1645
+#define B_SET_PASS 1646
/* *********************** */
#define B_ARMATUREBUTS 1800
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index a7c1e6c1e46..e341779c339 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -162,6 +162,7 @@ typedef struct PartialVisibility {
#define ME_SHARP (1<<9)
/* puno = vertexnormal (mface) */
+/* render assumes flips to be ordered like this */
#define ME_FLIPV1 1
#define ME_FLIPV2 2
#define ME_FLIPV3 4
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index b592a8fb56a..034369f6fe2 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -86,9 +86,12 @@ typedef struct bNodeSocket {
#define SOCK_RGBA 2
/* sock->flag, first bit is select */
+ /* hidden is user defined, to hide unused */
#define SOCK_HIDDEN 2
/* only used now for groups... */
#define SOCK_IN_USE 4
+ /* unavailable is for dynamic sockets */
+#define SOCK_UNAVAIL 8
#
#
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index d01973bce4f..f9055dfc11b 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -167,7 +167,7 @@ typedef struct Object {
void *sumohandle;
float bbsize[3];
- short dfras;
+ short index; /* custom index, for renderpasses */
unsigned short actdef; /* current deformation group */
float col[4];
/**
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 8bde77f45ab..2413bde0d1e 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -139,9 +139,11 @@ typedef struct SceneRenderLayer {
#define SCE_PASS_SPEC 16
#define SCE_PASS_SHADOW 32
#define SCE_PASS_AO 64
-#define SCE_PASS_RAY 128
+#define SCE_PASS_REFLECT 128
#define SCE_PASS_NORMAL 256
#define SCE_PASS_VECTOR 512
+#define SCE_PASS_REFRACT 1024
+#define SCE_PASS_INDEXOB 2048
typedef struct RenderData {
struct AviCodecData *avicodecdata;
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h
index 38a432962e0..f8c6e673ab3 100644
--- a/source/blender/render/extern/include/RE_shader_ext.h
+++ b/source/blender/render/extern/include/RE_shader_ext.h
@@ -48,22 +48,50 @@ typedef struct ShadeResult
float combined[4];
float col[4];
float alpha;
- float diff[3];
+ float diff[3]; /* includes ramps, shadow, etc */
+ float diff_raw[3]; /* pure diffuse, no shadow no ramps */
float spec[3];
float shad[3];
float ao[3];
- float ray[3];
+ float refl[3];
+ float refr[3];
float nor[3];
float winspeed[4];
-
} ShadeResult;
+/* only here for quick copy */
+struct ShadeInputCopy {
+
+ struct Material *mat;
+ struct VlakRen *vlr;
+ int facenr;
+ float facenor[3]; /* copy from face */
+ struct VertRen *v1, *v2, *v3; /* vertices can be in any order for quads... */
+ short i1, i2, i3; /* original vertex indices */
+ short puno;
+ float vn[3], vno[3]; /* actual render normal, and a copy to restore it */
+ float n1[3], n2[3], n3[3]; /* vertex normals, corrected */
+};
+
/* localized renderloop data */
typedef struct ShadeInput
{
+ /* copy from face, also to extract tria from quad */
+ /* note it mirrors a struct above for quick copy */
+
struct Material *mat;
struct VlakRen *vlr;
- float co[3];
+ int facenr;
+ float facenor[3]; /* copy from face */
+ struct VertRen *v1, *v2, *v3; /* vertices can be in any order for quads... */
+ short i1, i2, i3; /* original vertex indices */
+ short puno;
+ float vn[3], vno[3]; /* actual render normal, and a copy to restore it */
+ float n1[3], n2[3], n3[3]; /* vertex normals, corrected */
+
+ /* internal face coordinates */
+ float u, v, dx_u, dx_v, dy_u, dy_v;
+ float co[3], view[3];
/* copy from material, keep synced so we can do memcopy */
/* current size: 23*4 */
@@ -86,7 +114,7 @@ typedef struct ShadeInput
/* texture coordinates */
float lo[3], gl[3], uv[3], ref[3], orn[3], winco[3], sticky[3], vcol[3], rad[3];
- float vn[3], vno[3], facenor[3], view[3], refcol[4], displace[3];
+ float refcol[4], displace[3];
float strand, tang[3], stress, winspeed[4];
/* dx/dy OSA coordinates */
@@ -100,14 +128,20 @@ typedef struct ShadeInput
float dxrefract[3], dyrefract[3];
float dxstrand, dystrand;
- int xs, ys; /* pixel to be rendered */
- short do_preview; /* for nodes, in previewrender */
- short thread;
- short osatex, puno;
+ /* AO is a pre-process now */
+ float ao[3];
+
+ int xs, ys; /* pixel to be rendered */
+ short osatex;
int mask;
- int depth; /* 1 or larger on raytrace shading */
- int facenr;
+ int depth; /* 1 or larger on raytrace shading */
+
+ /* from initialize, part or renderlayer */
+ short do_preview; /* for nodes, in previewrender */
+ short thread, sample; /* sample: ShadeSample array index */
unsigned int lay;
+ int layflag, passflag;
+
} ShadeInput;
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index b963d440596..c68956d72e5 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -1886,6 +1886,8 @@ static void object_panel_object(Object *ob)
/* parent */
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", xco+5, 180, 305-xco, 20, &ob->parent, "Parent Object");
+
+ but = uiDefButS(block, NUM, B_NOP, "PassIndex:", xco+5, 150, 305-xco, 20, &ob->index, 0.0, 1000.0, 0, 0, "Object Pass Index");
uiDefBlockBut(block, add_groupmenu, NULL, "Add to Group", 10,150,150,20, "Add Object to a new Group");
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index b26e7daef77..e66c674993f 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -830,6 +830,13 @@ void do_render_panels(unsigned short event)
}
allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWNODE, 0);
+ break;
+ case B_SET_PASS:
+ if(G.scene->nodetree) {
+ ntreeCompositForceHidden(G.scene->nodetree);
+ allqueue(REDRAWBUTSSCENE, 0);
+ allqueue(REDRAWNODE, 0);
+ }
}
}
@@ -863,30 +870,6 @@ static uiBlock *edge_render_menu(void *arg_unused)
return block;
}
-#if 0
-/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
-static uiBlock *post_render_menu(void *arg_unused)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "post render", UI_EMBOSS, UI_HELV, curarea->win);
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -10, -10, 200, 120, NULL, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, 0, "Add:", 0,80,180,19, &G.scene->r.postadd, -1.0, 1.0, 0, 0, "");
- uiDefButF(block, NUMSLI, 0, "Mul:", 0,60,180,19, &G.scene->r.postmul, 0.01, 4.0, 0, 0, "");
- uiDefButF(block, NUMSLI, 0, "Gamma:", 0,40,180,19, &G.scene->r.postgamma, 0.1, 4.0, 0, 0, "");
- uiDefButF(block, NUMSLI, 0, "Hue:", 0,20,180,19, &G.scene->r.posthue, -0.5, 0.5, 0, 0, "");
- uiDefButF(block, NUMSLI, 0, "Sat:", 0, 0,180,19, &G.scene->r.postsat, 0.0, 4.0, 0, 0, "");
-
- uiBlockSetDirection(block, UI_TOP);
-
- addqueue(curarea->win, UI_BUT_EVENT, B_FBUF_REDO);
-
- return block;
-}
-#endif
/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
static uiBlock *framing_render_menu(void *arg_unused)
@@ -1291,7 +1274,6 @@ static void render_panel_render(void)
uiDefButF(block, NUM,B_DIFF,"", 627,34,60,20,&G.scene->r.gauss,0.5, 1.5, 10, 2, "Sets the filter size");
uiDefButBitI(block, TOG, R_BORDER, REDRAWVIEWCAM, "Border", 565,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image");
- uiDefButBitI(block, TOG, R_GAMMA, B_REDR, "Gamma", 627,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
uiBlockEndAlign(block);
}
@@ -1838,36 +1820,32 @@ static void render_panel_layers(void)
draw_3d_layer_buttons(block, &srl->lay, 130, 95, 35, 30);
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, SCE_LAY_SKY, B_NOP,"Sky", 10, 70, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Sky or backbuffer in this Layer");
- uiDefButBitS(block, TOG, SCE_LAY_SOLID, B_NOP,"Solid", 50, 70, 65, 20, &srl->layflag, 0, 0, 0, 0, "Render Solid faces in this Layer");
- uiDefButBitS(block, TOG, SCE_LAY_HALO, B_NOP,"Halo", 115, 70, 65, 20, &srl->layflag, 0, 0, 0, 0, "Render Halos in this Layer (on top of Solid)");
- uiDefButBitS(block, TOG, SCE_LAY_ZTRA, B_NOP,"Ztra", 180, 70, 65, 20, &srl->layflag, 0, 0, 0, 0, "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
- uiDefButBitS(block, TOG, SCE_LAY_EDGE, B_NOP,"Edge", 245, 70, 65, 20, &srl->layflag, 0, 0, 0, 0, "Render Edge-enhance in this Layer (only works for Solid faces)");
- uiDefButBitS(block, TOG, SCE_LAY_ALL_Z, B_NOP,"All Z values", 10, 50, 105, 20, &srl->layflag, 0, 0, 0, 0, "Fill in Z values for all not-rendered faces, for masking");
+ uiDefButBitS(block, TOG, SCE_LAY_ALL_Z, B_NOP,"AllZ", 10, 70, 40, 20, &srl->layflag, 0, 0, 0, 0, "Fill in Z values for all not-rendered faces, for masking");
+ uiBlockBeginAlign(block);
+ uiDefButBitS(block, TOG, SCE_LAY_SOLID, B_NOP,"Solid", 50, 70, 60, 20, &srl->layflag, 0, 0, 0, 0, "Render Solid faces in this Layer");
+ uiDefButBitS(block, TOG, SCE_LAY_HALO, B_NOP,"Halo", 110, 70, 55, 20, &srl->layflag, 0, 0, 0, 0, "Render Halos in this Layer (on top of Solid)");
+ uiDefButBitS(block, TOG, SCE_LAY_ZTRA, B_NOP,"Ztra", 165, 70, 55, 20, &srl->layflag, 0, 0, 0, 0, "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
+ uiDefButBitS(block, TOG, SCE_LAY_SKY, B_NOP,"Sky", 220, 70, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Sky or backbuffer in this Layer");
+ uiDefButBitS(block, TOG, SCE_LAY_EDGE, B_NOP,"Edge", 260, 70, 50, 20, &srl->layflag, 0, 0, 0, 0, "Render Edge-enhance in this Layer (only works for Solid faces)");
uiBlockEndAlign(block);
- uiDefBut(block, LABEL, 0, "Passes:", 10,30,150,20, NULL, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, SCE_PASS_COMBINED, B_NOP,"Combined", 10, 10, 150, 20, &srl->passflag, 0, 0, 0, 0, "Deliver full combined RGBA buffer");
- uiDefButBitS(block, TOG, SCE_PASS_Z, B_NOP,"Z", 160, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Z values pass");
- uiDefButBitS(block, TOG, SCE_PASS_VECTOR, B_NOP,"Vec", 200, 10, 55, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Vector pass");
- uiDefButBitS(block, TOG, SCE_PASS_NORMAL, B_NOP,"Nor", 255, 10, 55, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Normal pass");
-#if 0
- /* bring back after release */
+ uiDefBut(block, LABEL, 0, "Passes:", 10,30,50,20, NULL, 0, 0, 0, 0, "");
+
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, SCE_PASS_COMBINED, B_NOP,"Combined", 130, 30, 115, 20, &srl->passflag, 0, 0, 0, 0, "Deliver full combined RGBA buffer");
- uiDefButBitS(block, TOG, SCE_PASS_Z, B_NOP,"Z", 245, 30, 25, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Z values pass");
- uiDefButBitS(block, TOG, SCE_PASS_VECTOR, B_NOP,"Vec", 270, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Vector pass");
+ uiDefButBitS(block, TOG, SCE_PASS_COMBINED, B_NOP,"Combined", 60, 30, 85, 20, &srl->passflag, 0, 0, 0, 0, "Deliver full combined RGBA buffer");
+ uiDefButBitS(block, TOG, SCE_PASS_Z, B_SET_PASS,"Z", 145, 30, 25, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Z values pass");
+ uiDefButBitS(block, TOG, SCE_PASS_VECTOR, B_SET_PASS,"Vec", 170, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Speed Vector pass");
+ uiDefButBitS(block, TOG, SCE_PASS_NORMAL, B_SET_PASS,"Nor", 210, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Normal pass");
+ uiDefButBitS(block, TOG, SCE_PASS_INDEXOB, B_SET_PASS,"IndexOb",250, 30, 60, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Object Index pass");
- uiDefButBitS(block, TOG, SCE_PASS_RGBA, B_NOP,"Col", 10, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver shade-less Color pass");
- uiDefButBitS(block, TOG, SCE_PASS_DIFFUSE, B_NOP,"Diff",55, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Diffuse pass");
- uiDefButBitS(block, TOG, SCE_PASS_SPEC, B_NOP,"Spec", 100, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Specular pass");
- uiDefButBitS(block, TOG, SCE_PASS_SHADOW, B_NOP,"Shad", 145, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Shadow pass");
- uiDefButBitS(block, TOG, SCE_PASS_AO, B_NOP,"AO", 185, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver AO pass");
- uiDefButBitS(block, TOG, SCE_PASS_RAY, B_NOP,"Ray", 225, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Mirror and Transparent pass");
- uiDefButBitS(block, TOG, SCE_PASS_NORMAL, B_NOP,"Nor", 270, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Normal pass");
-#endif
+ uiDefButBitS(block, TOG, SCE_PASS_RGBA, B_SET_PASS,"Col", 10, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver shade-less Color pass");
+ uiDefButBitS(block, TOG, SCE_PASS_DIFFUSE, B_SET_PASS,"Diff", 55, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Diffuse pass");
+ uiDefButBitS(block, TOG, SCE_PASS_SPEC, B_SET_PASS,"Spec", 100, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Specular pass");
+ uiDefButBitS(block, TOG, SCE_PASS_SHADOW, B_SET_PASS,"Shad", 145, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Shadow pass");
+ uiDefButBitS(block, TOG, SCE_PASS_AO, B_SET_PASS,"AO", 185, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver AO pass");
+ uiDefButBitS(block, TOG, SCE_PASS_REFLECT, B_SET_PASS,"Refl", 225, 10, 45, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Reflection pass");
+ uiDefButBitS(block, TOG, SCE_PASS_REFRACT, B_SET_PASS,"Refr", 270, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Refraction pass");
+
}
void render_panels()
diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c
index cc5a37cf2fb..5f26009e71a 100644
--- a/source/blender/src/drawnode.c
+++ b/source/blender/src/drawnode.c
@@ -1580,10 +1580,10 @@ static void node_update_hidden(bNode *node)
/* calculate minimal radius */
for(nsock= node->inputs.first; nsock; nsock= nsock->next)
- if(!(nsock->flag & SOCK_HIDDEN))
+ if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
totin++;
for(nsock= node->outputs.first; nsock; nsock= nsock->next)
- if(!(nsock->flag & SOCK_HIDDEN))
+ if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
totout++;
tot= MAX2(totin, totout);
@@ -1600,7 +1600,7 @@ static void node_update_hidden(bNode *node)
rad=drad= M_PI/(1.0f + (float)totout);
for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & SOCK_HIDDEN)) {
+ if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
nsock->locx= node->totr.xmax - hiddenrad + sin(rad)*hiddenrad;
nsock->locy= node->totr.ymin + hiddenrad + cos(rad)*hiddenrad;
rad+= drad;
@@ -1611,7 +1611,7 @@ static void node_update_hidden(bNode *node)
rad=drad= - M_PI/(1.0f + (float)totin);
for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & SOCK_HIDDEN)) {
+ if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
nsock->locx= node->totr.xmin + hiddenrad + sin(rad)*hiddenrad;
nsock->locy= node->totr.ymin + hiddenrad + cos(rad)*hiddenrad;
rad+= drad;
@@ -1634,7 +1634,7 @@ static void node_update(bNode *node)
/* output sockets */
for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & SOCK_HIDDEN)) {
+ if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
nsock->locx= node->locx + node->width;
nsock->locy= dy - NODE_DYS;
dy-= NODE_DY;
@@ -1690,7 +1690,7 @@ static void node_update(bNode *node)
/* input sockets */
for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & SOCK_HIDDEN)) {
+ if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
nsock->locx= node->locx;
nsock->locy= dy - NODE_DYS;
dy-= NODE_DY;
@@ -1921,7 +1921,7 @@ static void node_draw_basis(ScrArea *sa, SpaceNode *snode, bNode *node)
/* socket inputs, buttons */
for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT);
if(block && sock->link==NULL) {
@@ -1963,7 +1963,7 @@ static void node_draw_basis(ScrArea *sa, SpaceNode *snode, bNode *node)
/* socket outputs */
for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT);
BIF_ThemeColor(TH_TEXT);
@@ -2051,12 +2051,12 @@ void node_draw_hidden(SpaceNode *snode, bNode *node)
/* sockets */
for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN))
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT);
}
for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN))
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT);
}
}
@@ -2080,6 +2080,12 @@ void node_draw_link(SpaceNode *snode, bNodeLink *link)
do_shaded= 0;
}
else {
+ /* going to give issues once... */
+ if(link->tosock->flag & SOCK_UNAVAIL)
+ return;
+ if(link->fromsock->flag & SOCK_UNAVAIL)
+ return;
+
/* a bit ugly... but thats how we detect the internal group links */
if(link->fromnode==link->tonode) {
BIF_ThemeColorBlend(TH_BACK, TH_WIRE, 0.25f);
@@ -2202,7 +2208,7 @@ static void node_draw_group_links(SpaceNode *snode, bNode *gnode)
fakelink.tonode= fakelink.fromnode= gnode;
for(sock= gnode->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
if(sock->tosock) {
fakelink.fromsock= sock;
fakelink.tosock= sock->tosock;
@@ -2212,7 +2218,7 @@ static void node_draw_group_links(SpaceNode *snode, bNode *gnode)
}
for(sock= gnode->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
if(sock->tosock) {
fakelink.tosock= sock;
fakelink.fromsock= sock->tosock;
@@ -2261,10 +2267,10 @@ static void node_draw_group(ScrArea *sa, SpaceNode *snode, bNode *gnode)
/* group sockets */
for(sock= gnode->inputs.first; sock; sock= sock->next)
- if(!(sock->flag & SOCK_HIDDEN))
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT);
for(sock= gnode->outputs.first; sock; sock= sock->next)
- if(!(sock->flag & SOCK_HIDDEN))
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT);
/* and finally the whole tree */
diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c
index 26196e16c9a..245a4a5339a 100644
--- a/source/blender/src/editnode.c
+++ b/source/blender/src/editnode.c
@@ -370,6 +370,8 @@ void node_composit_default(Scene *sce)
nodeAddLink(sce->nodetree, in, fromsock, out, tosock);
ntreeSolveOrder(sce->nodetree); /* needed for pointers */
+
+ ntreeCompositForceHidden(sce->nodetree);
}
/* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */
@@ -395,6 +397,11 @@ void snode_set_context(SpaceNode *snode)
else if(snode->treetype==NTREE_COMPOSIT) {
snode->from= NULL;
snode->id= &G.scene->id;
+
+ /* bit clumsy but reliable way to see if we draw first time */
+ if(snode->nodetree==NULL)
+ ntreeCompositForceHidden(G.scene->nodetree);
+
snode->nodetree= G.scene->nodetree;
}
@@ -816,7 +823,7 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
for(node= snode->edittree->nodes.first; node; node= node->next) {
if(in_out & SOCK_IN) {
for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
if(node == visible_node(snode, &rect)) {
*nodep= node;
@@ -829,7 +836,7 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
}
if(in_out & SOCK_OUT) {
for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
if(node == visible_node(snode, &rect)) {
*nodep= node;
@@ -1411,6 +1418,10 @@ bNode *node_add_node(SpaceNode *snode, int type, float locx, float locy)
if(node->id)
id_us_plus(node->id);
+
+ if(snode->nodetree->type==NTREE_COMPOSIT)
+ ntreeCompositForceHidden(G.scene->nodetree);
+
}
return node;
}