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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-08 17:09:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-08 17:09:09 +0400
commit98bdf0274b1052efe25b6216f488d2a40fa43d1c (patch)
tree71e65d918ccbf3c5addd8236c74362dfbdea466c /source/blender
parentda84f3d4c94cb539f2ed80c8ec57602c05b95560 (diff)
parent3dead22c7322cf72ee63a003ba50940abc12e7c9 (diff)
svn merge ^/trunk/blender -r43183:43220
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenfont/intern/blf.c25
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c10
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/BKE_node.h2
-rw-r--r--source/blender/blenkernel/intern/node.c5
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c60
-rw-r--r--source/blender/blenloader/intern/readfile.c65
-rw-r--r--source/blender/editors/animation/anim_filter.c8
-rw-r--r--source/blender/editors/interface/interface_templates.c4
-rw-r--r--source/blender/editors/interface/view2d_ops.c9
-rw-r--r--source/blender/editors/object/object_edit.c331
-rw-r--r--source/blender/editors/screen/screen_ops.c16
-rw-r--r--source/blender/editors/space_node/node_draw.c20
-rw-r--r--source/blender/editors/space_node/node_edit.c67
-rw-r--r--source/blender/editors/space_node/node_intern.h4
-rw-r--r--source/blender/imbuf/IMB_imbuf.h8
-rw-r--r--source/blender/makesdna/DNA_node_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c4
-rw-r--r--source/blender/makesrna/intern/rna_screen.c10
-rw-r--r--source/blender/nodes/intern/node_common.c4
-rw-r--r--source/blender/nodes/shader/node_shader_util.c2
-rw-r--r--source/blender/render/intern/source/pipeline.c9
-rw-r--r--source/blender/render/intern/source/rayshade.c13
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c14
25 files changed, 210 insertions, 486 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index f8018e05431..a387b416c38 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -479,7 +479,7 @@ void BLF_rotation_default(float angle)
}
}
-static void blf_draw__start(FontBLF *font, GLint *mode)
+static void blf_draw__start(FontBLF *font, GLint *mode, GLint *param)
{
/*
* The pixmap alignment hack is handle
@@ -516,10 +516,19 @@ static void blf_draw__start(FontBLF *font, GLint *mode)
/* always bind the texture for the first glyph */
font->tex_bind_state= -1;
+
+ /* Save the current parameter to restore it later. */
+ glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
+ if (*param != GL_MODULATE)
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
-static void blf_draw__end(GLint mode)
+static void blf_draw__end(GLint mode, GLint param)
{
+ /* and restore the original value. */
+ if (param != GL_MODULATE)
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
+
glMatrixMode(GL_TEXTURE);
glPopMatrix();
@@ -536,24 +545,24 @@ static void blf_draw__end(GLint mode)
void BLF_draw(int fontid, const char *str, size_t len)
{
FontBLF *font= BLF_get(fontid);
- GLint mode;
+ GLint mode, param;
if (font && font->glyph_cache) {
- blf_draw__start(font, &mode);
+ blf_draw__start(font, &mode, &param);
blf_font_draw(font, str, len);
- blf_draw__end(mode);
+ blf_draw__end(mode, param);
}
}
void BLF_draw_ascii(int fontid, const char *str, size_t len)
{
FontBLF *font= BLF_get(fontid);
- GLint mode;
+ GLint mode, param;
if (font && font->glyph_cache) {
- blf_draw__start(font, &mode);
+ blf_draw__start(font, &mode, &param);
blf_font_draw_ascii(font, str, len);
- blf_draw__end(mode);
+ blf_draw__end(mode, param);
}
}
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index f8c589a7051..f0cfcdc97b9 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -368,7 +368,6 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
float dx, dx1;
float y1, y2;
float xo, yo;
- GLint param;
if ((!g->width) || (!g->height))
return 1;
@@ -450,11 +449,6 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state= g->tex));
}
- /* Save the current parameter to restore it later. */
- glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &param);
- if (param != GL_MODULATE)
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
if (font->flags & BLF_SHADOW) {
switch(font->shadow) {
@@ -493,9 +487,5 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
break;
}
- /* and restore the original value. */
- if (param != GL_MODULATE)
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
-
return 1;
}
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 91c417624b6..ff43d54a902 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 261
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 1
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 6234308048b..9fdae5b190e 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -374,6 +374,8 @@ int nodeUpdateID(struct bNodeTree *ntree, struct ID *id);
void nodeFreePreview(struct bNode *node);
+int nodeSocketIsHidden(struct bNodeSocket *sock);
+
/* ************** NODE TYPE ACCESS *************** */
struct bNodeTemplate nodeMakeTemplate(struct bNode *node);
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index ce1dd429794..5253d7a9961 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1325,6 +1325,11 @@ void nodeSetActive(bNodeTree *ntree, bNode *node)
node->flag |= NODE_ACTIVE_TEXTURE;
}
+int nodeSocketIsHidden(bNodeSocket *sock)
+{
+ return ((sock->flag & (SOCK_HIDDEN | SOCK_AUTO_HIDDEN | SOCK_UNAVAIL)) != 0);
+}
+
/* ************** dependency stuff *********** */
/* node is guaranteed to be not checked before */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index ebe360ef91b..6d37c9ca04c 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -78,8 +78,6 @@
//XXX #include "BIF_previewrender.h"
//XXX #include "BIF_editseq.h"
-//XXX #include "nla.h"
-
#ifdef WIN32
#else
#include <sys/time.h>
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 718b3144677..731f82e1b80 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -1574,7 +1574,6 @@ typedef struct WipeZone {
int flip;
int xo, yo;
int width;
- float invwidth;
float pythangle;
} WipeZone;
@@ -1585,33 +1584,25 @@ static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo
wipezone->xo = xo;
wipezone->yo = yo;
wipezone->width = (int)(wipe->edgeWidth*((xo+yo)/2.0f));
- wipezone->pythangle = 1.0f/sqrtf(wipe->angle*wipe->angle + 1.0f);
-
- if(wipe->wipetype == DO_SINGLE_WIPE)
- wipezone->invwidth = 1.0f/wipezone->width;
- else
- wipezone->invwidth = 1.0f/(0.5f*wipezone->width);
+ wipezone->pythangle = 1.0f/sqrtf(wipezone->angle*wipezone->angle + 1.0f);
}
// This function calculates the blur band for the wipe effects
-static float in_band(WipeZone *wipezone,float width,float dist,float perc,int side,int dir)
+static float in_band(float width,float dist,int side,int dir)
{
- float t1,t2,alpha;
+ float alpha;
if(width == 0)
return (float)side;
-
+
if(width < dist)
- return side;
-
- t1 = dist * wipezone->invwidth; //percentange of width that is
- t2 = wipezone->invwidth; //amount of alpha per % point
-
+ return (float)side;
+
if(side == 1)
- alpha = (t1*t2*100) + (1-perc); // add point's alpha contrib to current position in wipe
+ alpha = (dist+0.5*width) / (width);
else
- alpha = (1-perc) - (t1*t2*100);
-
+ alpha = (0.5*width-dist) / (width);
+
if(dir == 0)
alpha = 1-alpha;
@@ -1648,7 +1639,6 @@ float hyp3,hyp4,b4,b5
switch (wipe->wipetype) {
case DO_SINGLE_WIPE:
width = wipezone->width;
- hwidth = width*0.5f;
if(angle == 0.0f) {
b1 = posy;
@@ -1669,15 +1659,15 @@ float hyp3,hyp4,b4,b5
if(wipe->forward) {
if(b1 < b2)
- output = in_band(wipezone,width,hyp,facf0,1,1);
+ output = in_band(width,hyp,1,1);
else
- output = in_band(wipezone,width,hyp,facf0,0,1);
+ output = in_band(width,hyp,0,1);
}
else {
if(b1 < b2)
- output = in_band(wipezone,width,hyp,facf0,0,1);
+ output = in_band(width,hyp,0,1);
else
- output = in_band(wipezone,width,hyp,facf0,1,1);
+ output = in_band(width,hyp,1,1);
}
break;
@@ -1700,27 +1690,23 @@ float hyp3,hyp4,b4,b5
b3 = (yo-posy*0.5f) - (-angle)*(xo-posx*0.5f);
b2 = y - (-angle)*x;
- hyp = abs(angle*x+y+(-posy*0.5f-angle*posx*0.5f))*wipezone->pythangle;
- hyp2 = abs(angle*x+y+(-(yo-posy*0.5f)-angle*(xo-posx*0.5f)))*wipezone->pythangle;
+ hyp = fabsf(angle*x+y+(-posy*0.5f-angle*posx*0.5f))*wipezone->pythangle;
+ hyp2 = fabsf(angle*x+y+(-(yo-posy*0.5f)-angle*(xo-posx*0.5f)))*wipezone->pythangle;
}
- temp1 = xo*(1-facf0*0.5f)-xo*facf0*0.5f;
- temp2 = yo*(1-facf0*0.5f)-yo*facf0*0.5f;
- pointdist = sqrt(temp1*temp1 + temp2*temp2);
+ hwidth= MIN2(hwidth, fabsf(b3-b1)/2.0f);
if(b2 < b1 && b2 < b3 ){
- if(hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp,facf0,0,1);
+ output = in_band(hwidth,hyp,0,1);
} else if(b2 > b1 && b2 > b3 ){
- if(hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp2,facf0,0,1);
+ output = in_band(hwidth,hyp2,0,1);
} else {
if( hyp < hwidth && hyp2 > hwidth )
- output = in_band(wipezone,hwidth,hyp,facf0,1,1);
+ output = in_band(hwidth,hyp,1,1);
else if( hyp > hwidth && hyp2 < hwidth )
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1);
+ output = in_band(hwidth,hyp2,1,1);
else
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
+ output = in_band(hwidth,hyp2,1,1) * in_band(hwidth,hyp,1,1);
}
if(!wipe->forward)output = 1-output;
break;
@@ -1840,8 +1826,8 @@ float hyp3,hyp4,b4,b5
pointdist = sqrt(temp1*temp1 + temp1*temp1);
temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
- if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1);
- else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1);
+ if(temp2 > pointdist) output = in_band(hwidth,fabs(temp2-pointdist),0,1);
+ else output = in_band(hwidth,fabs(temp2-pointdist),1,1);
if(!wipe->forward) output = 1-output;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c44b95fb353..a3b2c721213 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7626,6 +7626,32 @@ static void do_versions_nodetree_socket_use_flags_2_62(bNodeTree *ntree)
}
}
+/* set the SOCK_AUTO_HIDDEN flag on collapsed nodes */
+static void do_versions_nodetree_socket_auto_hidden_flags_2_62(bNodeTree *ntree)
+{
+ bNode *node;
+ bNodeSocket *sock;
+
+ for (node=ntree->nodes.first; node; node=node->next) {
+ if (node->flag & NODE_HIDDEN) {
+ for (sock=node->inputs.first; sock; sock=sock->next) {
+ if (sock->link==NULL)
+ sock->flag |= SOCK_AUTO_HIDDEN;
+ }
+ for(sock=node->outputs.first; sock; sock= sock->next) {
+ if(nodeCountSocketLinks(ntree, sock)==0)
+ sock->flag |= SOCK_AUTO_HIDDEN;
+ }
+ }
+ else {
+ for(sock=node->inputs.first; sock; sock= sock->next)
+ sock->flag &= ~SOCK_AUTO_HIDDEN;
+ for(sock=node->outputs.first; sock; sock= sock->next)
+ sock->flag &= ~SOCK_AUTO_HIDDEN;
+ }
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -12858,7 +12884,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- /* put compatibility code here until next subversion bump */
+ if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 1))
{
{
/* update use flags for node sockets (was only temporary before) */
@@ -12958,6 +12984,43 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
+ {
+ /* set the SOCK_AUTO_HIDDEN flag on collapsed nodes */
+ Scene *sce;
+ Material *mat;
+ Tex *tex;
+ Lamp *lamp;
+ World *world;
+ bNodeTree *ntree;
+
+ for (sce=main->scene.first; sce; sce=sce->id.next)
+ if (sce->nodetree)
+ do_versions_nodetree_socket_auto_hidden_flags_2_62(sce->nodetree);
+
+ for (mat=main->mat.first; mat; mat=mat->id.next)
+ if (mat->nodetree)
+ do_versions_nodetree_socket_auto_hidden_flags_2_62(mat->nodetree);
+
+ for (tex=main->tex.first; tex; tex=tex->id.next)
+ if (tex->nodetree)
+ do_versions_nodetree_socket_auto_hidden_flags_2_62(tex->nodetree);
+
+ for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
+ if (lamp->nodetree)
+ do_versions_nodetree_socket_auto_hidden_flags_2_62(lamp->nodetree);
+
+ for (world=main->world.first; world; world=world->id.next)
+ if (world->nodetree)
+ do_versions_nodetree_socket_auto_hidden_flags_2_62(world->nodetree);
+
+ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+ do_versions_nodetree_socket_auto_hidden_flags_2_62(ntree);
+ }
+ }
+
+ /* put compatibility code here until next subversion bump */
+ {
+
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 45b715c406a..b84ec5427c5 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1852,6 +1852,10 @@ static size_t animdata_filter_ds_world (bAnimContext *ac, ListBase *anim_data, b
/* textures for world */
if (!(ads->filterflag & ADS_FILTER_NOTEX))
items += animdata_filter_ds_textures(ac, &tmp_data, ads, (ID *)wo, filter_mode);
+
+ /* nodes */
+ if ((wo->nodetree) && !(ads->filterflag & ADS_FILTER_NONTREE))
+ tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)wo, wo->nodetree, filter_mode);
}
END_ANIMFILTER_SUBCHANNELS;
@@ -1947,12 +1951,12 @@ static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_
}
/* world */
- if ((wo && wo->adt) && !(ads->filterflag & ADS_FILTER_NOWOR)) {
+ if ((wo) && !(ads->filterflag & ADS_FILTER_NOWOR)) {
tmp_items += animdata_filter_ds_world(ac, &tmp_data, ads, sce, wo, filter_mode);
}
/* nodetree */
- if ((ntree && ntree->adt) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
+ if ((ntree) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)sce, ntree, filter_mode);
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6b842a6d409..2cf73eeea6d 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -55,6 +55,7 @@
#include "BKE_texture.h"
#include "BKE_report.h"
#include "BKE_displist.h"
+#include "BKE_scene.h"
#include "ED_screen.h"
#include "ED_object.h"
@@ -2125,6 +2126,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
else if(RNA_struct_is_a(itemptr->type, &RNA_MaterialSlot)) {
/* provision to draw active node name */
Material *ma, *manode;
+ Scene *scene= CTX_data_scene(C);
Object *ob= (Object*)ptr->id.data;
int index= (Material**)itemptr->data - ob->mat;
@@ -2132,7 +2134,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiItemL(sub, name, icon);
ma= give_current_material(ob, index+1);
- if(ma) {
+ if (ma && !scene_use_new_shading_nodes(scene)){
manode= give_node_material(ma);
if(manode) {
char str[MAX_ID_NAME + 12];
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 5706da93fe9..a993e651b5f 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -248,20 +248,19 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
view_pan_apply(op);
}
break;
-
+ /* XXX - Mode switching isn't implemented. See comments in 36818.
+ * switch to zoom *
case LEFTMOUSE:
- /* switch to zoom */
if (event->val==KM_PRESS) {
- /* calculate overall delta mouse-movement for redo */
+ * calculate overall delta mouse-movement for redo *
RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx));
RNA_int_set(op->ptr, "deltay", (vpd->starty - vpd->lasty));
view_pan_exit(op);
WM_cursor_restore(CTX_wm_window(C));
-
WM_operator_name_call(C, "VIEW2D_OT_zoom", WM_OP_INVOKE_DEFAULT, NULL);
return OPERATOR_FINISHED;
- }
+ }*/
default:
if (event->type == vpd->invoke_event || event->type==ESCKEY) {
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index fcb6e3c3610..494effc8f45 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -109,7 +109,6 @@ static void waitcursor(int UNUSED(val)) {}
static int pupmenu(const char *UNUSED(msg)) {return 0;}
/* port over here */
-static bContext *evil_C;
static void error_libdata(void) {}
Object *ED_object_context(bContext *C)
@@ -723,240 +722,6 @@ static void spot_interactive(Object *ob, int mode)
}
#endif
-static void UNUSED_FUNCTION(special_editmenu)(Scene *scene, View3D *v3d)
-{
-// XXX static short numcuts= 2;
- Object *ob= OBACT;
- Object *obedit= NULL; // XXX
- int nr,ret=0;
-
- if(ob==NULL) return;
-
- if(obedit==NULL) {
-
- if(ob->mode & OB_MODE_POSE) {
-// XXX pose_special_editmenu();
- }
- else if(paint_facesel_test(ob)) {
- Mesh *me= get_mesh(ob);
- MTFace *tface;
- MFace *mface;
- int a;
-
- if(me==NULL || me->mtface==NULL) return;
-
- nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5| TwoSide%x6|Clr Tex%x7| Shared%x8| Light%x9| Invisible%x10| Collision%x11| TwoSide%x12");
-
- tface= me->mtface;
- mface= me->mface;
- for(a=me->totface; a>0; a--, tface++, mface++) {
- if(mface->flag & ME_FACE_SEL) {
- switch(nr) {
- case 1:
- tface->mode |= TF_TEX; break;
- case 2:
- tface->mode |= TF_SHAREDCOL; break;
- case 3:
- tface->mode |= TF_LIGHT; break;
- case 4:
- tface->mode |= TF_INVISIBLE; break;
- case 5:
- tface->mode |= TF_DYNAMIC; break;
- case 6:
- tface->mode |= TF_TWOSIDE; break;
- case 7:
- tface->mode &= ~TF_TEX;
- tface->tpage= NULL;
- break;
- case 8:
- tface->mode &= ~TF_SHAREDCOL; break;
- case 9:
- tface->mode &= ~TF_LIGHT; break;
- case 10:
- tface->mode &= ~TF_INVISIBLE; break;
- case 11:
- tface->mode &= ~TF_DYNAMIC; break;
- case 12:
- tface->mode &= ~TF_TWOSIDE; break;
- }
- }
- }
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- }
- else if(ob->mode & OB_MODE_VERTEX_PAINT) {
- Mesh *me= get_mesh(ob);
-
- if(me==NULL || (me->mcol==NULL && me->mtface==NULL) ) return;
-
- nr= pupmenu("Specials%t|Shared VertexCol%x1");
- if(nr==1) {
-
-// XXX do_shared_vertexcol(me);
-
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- }
- }
- else if(ob->mode & OB_MODE_WEIGHT_PAINT) {
- Object *par= modifiers_isDeformedByArmature(ob);
-
- if(par && (par->mode & OB_MODE_POSE)) {
-// XXX nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2");
-
-// XXX if(nr==1 || nr==2)
-// XXX pose_adds_vgroups(ob, (nr == 2));
- }
- }
- else if(ob->mode & OB_MODE_PARTICLE_EDIT) {
-#if 0
- // XXX
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEditSettings *pset = PE_settings();
-
- if(!psys)
- return;
-
- if(pset->selectmode & SCE_SELECT_POINT)
- nr= pupmenu("Specials%t|Rekey%x1|Subdivide%x2|Select First%x3|Select Last%x4|Remove Doubles%x5");
- else
- nr= pupmenu("Specials%t|Rekey%x1|Remove Doubles%x5");
-
- switch(nr) {
- case 1:
-// XXX if(button(&pset->totrekey, 2, 100, "Number of Keys:")==0) return;
- waitcursor(1);
- PE_rekey();
- break;
- case 2:
- PE_subdivide();
- break;
- case 3:
- PE_select_root();
- break;
- case 4:
- PE_select_tip();
- break;
- case 5:
- PE_remove_doubles();
- break;
- }
-
- DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
-
- if(nr>0) waitcursor(0);
-#endif
- }
- else {
- Base *base, *base_select= NULL;
-
- /* Get the active object mesh. */
- Mesh *me= get_mesh(ob);
-
- /* Booleans, if the active object is a mesh... */
- if (me && ob->id.lib==NULL) {
-
- /* Bring up a little menu with the boolean operation choices on. */
- nr= pupmenu("Boolean Tools%t|Intersect%x1|Union%x2|Difference%x3|Add Intersect Modifier%x4|Add Union Modifier%x5|Add Difference Modifier%x6");
-
- if (nr > 0) {
- /* user has made a choice of a menu element.
- All of the boolean functions require 2 mesh objects
- we search through the object list to find the other
- selected item and make sure it is distinct and a mesh. */
-
- for(base= FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(v3d, base)) {
- if(base->object != ob) base_select= base;
- }
- }
-
- if (base_select) {
- if (get_mesh(base_select->object)) {
- if(nr <= 3){
- waitcursor(1);
-// XXX ret = NewBooleanMesh(BASACT,base_select,nr);
- if (ret==0) {
- error("An internal error occurred");
- } else if(ret==-1) {
- error("Selected meshes must have faces to perform boolean operations");
- } else if (ret==-2) {
- error("Both meshes must be a closed mesh");
- }
- waitcursor(0);
- } else {
- BooleanModifierData *bmd = NULL;
- bmd = (BooleanModifierData *)modifier_new(eModifierType_Boolean);
- BLI_addtail(&ob->modifiers, bmd);
- modifier_unique_name(&ob->modifiers, (ModifierData*)bmd);
- bmd->object = base_select->object;
- bmd->modifier.mode |= eModifierMode_Realtime;
- switch(nr){
- case 4: bmd->operation = eBooleanModifierOp_Intersect; break;
- case 5: bmd->operation = eBooleanModifierOp_Union; break;
- case 6: bmd->operation = eBooleanModifierOp_Difference; break;
- }
-// XXX do_common_editbuts(B_CHANGEDEP);
- }
- } else {
- error("Please select 2 meshes");
- }
- } else {
- error("Please select 2 meshes");
- }
- }
-
- }
- else if (ob->type == OB_FONT) {
- /* removed until this gets a decent implementation (ton) */
-/* nr= pupmenu("Split %t|Characters%x1");
- if (nr > 0) {
- switch(nr) {
- case 1: split_font();
- }
- }
-*/
- }
- }
- }
- else if(obedit->type==OB_MESH) {
- }
- else if(ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- }
- else if(obedit->type==OB_ARMATURE) {
- nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Switch Direction%x7|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6");
-// if(nr==1)
-// XXX subdivide_armature(1);
- if(nr==2) {
-// XXX if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- waitcursor(1);
-// XXX subdivide_armature(numcuts);
- }
-// else if(nr==3)
-// XXX armature_flip_names();
- else if(ELEM3(nr, 4, 5, 6)) {
-// XXX armature_autoside_names(nr-4);
- }
-// else if(nr == 7)
-// XXX switch_direction_armature();
- }
- else if(obedit->type==OB_LATTICE) {
- Lattice *lt= obedit->data;
- static float weight= 1.0f;
- { // XXX
-// XXX if(fbutton(&weight, 0.0f, 1.0f, 10, 10, "Set Weight")) {
- Lattice *editlt= lt->editlatt->latt;
- int a= editlt->pntsu*editlt->pntsv*editlt->pntsw;
- BPoint *bp= editlt->def;
-
- while(a--) {
- if(bp->f1 & SELECT)
- bp->weight= weight;
- bp++;
- }
- }
- }
-
-}
-
static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
{
//XXX no longer used - to be removed - replaced by game_properties_copy_exec
@@ -1679,102 +1444,6 @@ static void UNUSED_FUNCTION(image_aspect)(Scene *scene, View3D *v3d)
}
-static int vergbaseco(const void *a1, const void *a2)
-{
- Base **x1, **x2;
-
- x1= (Base **) a1;
- x2= (Base **) a2;
-
- if( (*x1)->sy > (*x2)->sy ) return 1;
- else if( (*x1)->sy < (*x2)->sy) return -1;
- else if( (*x1)->sx > (*x2)->sx ) return 1;
- else if( (*x1)->sx < (*x2)->sx ) return -1;
-
- return 0;
-}
-
-
-static void UNUSED_FUNCTION(auto_timeoffs)(Scene *scene, View3D *v3d)
-{
- Base *base, **basesort, **bs;
- float start, delta;
- int tot=0, a;
- short offset=25;
-
- if(BASACT==NULL || v3d==NULL) return;
-// XXX if(button(&offset, 0, 1000,"Total time")==0) return;
-
- /* make array of all bases, xco yco (screen) */
- for(base= FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(v3d, base)) {
- tot++;
- }
- }
-
- delta= (float)offset/(float)tot;
- start= OBACT->sf;
-
- bs= basesort= MEM_mallocN(sizeof(void *)*tot,"autotimeoffs");
- for(base= FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(v3d, base)) {
- *bs= base;
- bs++;
- }
- }
- qsort(basesort, tot, sizeof(void *), vergbaseco);
-
- bs= basesort;
- for(a=0; a<tot; a++) {
-
- (*bs)->object->sf= start;
- start+= delta;
-
- bs++;
- }
- MEM_freeN(basesort);
-
-}
-
-static void UNUSED_FUNCTION(ofs_timeoffs)(Scene *scene, View3D *v3d)
-{
- float offset=0.0f;
-
- if(BASACT==NULL || v3d==NULL) return;
-
-// XXX if(fbutton(&offset, -10000.0f, 10000.0f, 10, 10, "Offset")==0) return;
-
- /* make array of all bases, xco yco (screen) */
- CTX_DATA_BEGIN(evil_C, Object*, ob, selected_editable_objects) {
- ob->sf += offset;
- if (ob->sf < -MAXFRAMEF) ob->sf = -MAXFRAMEF;
- else if (ob->sf > MAXFRAMEF) ob->sf = MAXFRAMEF;
- }
- CTX_DATA_END;
-
-}
-
-
-static void UNUSED_FUNCTION(rand_timeoffs)(Scene *scene, View3D *v3d)
-{
- Base *base;
- float rand_ofs=0.0f;
-
- if(BASACT==NULL || v3d==NULL) return;
-
-// XXX if(fbutton(&rand_ofs, 0.0f, 10000.0f, 10, 10, "Randomize")==0) return;
-
- rand_ofs *= 2;
-
- for(base= FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(v3d, base)) {
- base->object->sf += ((float)BLI_drand()-0.5f) * rand_ofs;
- if (base->object->sf < -MAXFRAMEF) base->object->sf = -MAXFRAMEF;
- else if (base->object->sf > MAXFRAMEF) base->object->sf = MAXFRAMEF;
- }
- }
-
-}
static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index de67a702598..b2192b9dabb 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3307,7 +3307,6 @@ static void SCREEN_OT_delete(wmOperatorType *ot)
static int scene_new_exec(bContext *C, wmOperator *op)
{
Scene *newscene, *scene= CTX_data_scene(C);
- bScreen *screen= CTX_wm_screen(C);
Main *bmain= CTX_data_main(C);
int type= RNA_enum_get(op->ptr, "type");
@@ -3326,11 +3325,9 @@ static int scene_new_exec(bContext *C, wmOperator *op)
}
}
- /* this notifier calls ED_screen_set_scene, doing a lot of UI stuff, not for inside event loops */
- WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, newscene);
+ ED_screen_set_scene(C, newscene);
- if(screen)
- screen->scene= newscene;
+ WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, newscene);
return OPERATOR_FINISHED;
}
@@ -3366,9 +3363,14 @@ static void SCENE_OT_new(wmOperatorType *ot)
static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
-
+
+ ED_screen_delete_scene(C, scene);
+
+ if(G.f & G_DEBUG)
+ printf("scene delete %p\n", scene);
+
WM_event_add_notifier(C, NC_SCENE|NA_REMOVED, scene);
-
+
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 7b692f55965..da7f22b2030 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -233,7 +233,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
/* output sockets */
for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+ if(!nodeSocketIsHidden(nsock)) {
nsock->locx= locx + node->width;
nsock->locy= dy - NODE_DYS;
dy-= NODE_DY;
@@ -312,7 +312,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
/* input sockets */
for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+ if(!nodeSocketIsHidden(nsock)) {
nsock->locx= locx;
nsock->locy= dy - NODE_DYS;
dy-= NODE_DY;
@@ -351,10 +351,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|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE))
+ if(!nodeSocketIsHidden(nsock))
totin++;
for(nsock= node->outputs.first; nsock; nsock= nsock->next)
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE))
+ if(!nodeSocketIsHidden(nsock))
totout++;
tot= MAX2(totin, totout);
@@ -371,7 +371,7 @@ static void node_update_hidden(bNode *node)
rad=drad= (float)M_PI/(1.0f + (float)totout);
for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE)) {
+ if(!nodeSocketIsHidden(nsock)) {
nsock->locx= node->totr.xmax - hiddenrad + (float)sin(rad)*hiddenrad;
nsock->locy= node->totr.ymin + hiddenrad + (float)cos(rad)*hiddenrad;
rad+= drad;
@@ -382,7 +382,7 @@ static void node_update_hidden(bNode *node)
rad=drad= - (float)M_PI/(1.0f + (float)totin);
for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE)) {
+ if(!nodeSocketIsHidden(nsock)) {
nsock->locx= node->totr.xmin + hiddenrad + (float)sin(rad)*hiddenrad;
nsock->locy= node->totr.ymin + hiddenrad + (float)cos(rad)*hiddenrad;
rad+= drad;
@@ -713,7 +713,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
for(sock= node->inputs.first; sock; sock= sock->next) {
bNodeSocketType *stype= ntreeGetSocketType(sock->type);
- if(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))
+ if(nodeSocketIsHidden(sock))
continue;
node_socket_circle_draw(ntree, sock, NODE_SOCKSIZE);
@@ -736,7 +736,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
RNA_pointer_create((ID*)ntree, &RNA_NodeSocket, sock, &sockptr);
- if(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))
+ if(nodeSocketIsHidden(sock))
continue;
node_socket_circle_draw(ntree, sock, NODE_SOCKSIZE);
@@ -854,12 +854,12 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
/* sockets */
for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (sock->flag & SOCK_IN_USE))
+ if(!nodeSocketIsHidden(sock))
node_socket_circle_draw(snode->nodetree, sock, socket_size);
}
for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (sock->flag & SOCK_IN_USE))
+ if(!nodeSocketIsHidden(sock))
node_socket_circle_draw(snode->nodetree, sock, socket_size);
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 87a56274035..20fb385efdd 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1600,40 +1600,38 @@ void NODE_OT_resize(wmOperatorType *ot)
/* ********************** hidden sockets ******************** */
-int node_has_hidden_sockets(bNode *node)
+int node_has_hidden_sockets(bNode *node, short flag)
{
bNodeSocket *sock;
for(sock= node->inputs.first; sock; sock= sock->next)
- if(sock->flag & SOCK_HIDDEN)
+ if(sock->flag & flag)
return 1;
for(sock= node->outputs.first; sock; sock= sock->next)
- if(sock->flag & SOCK_HIDDEN)
+ if(sock->flag & flag)
return 1;
return 0;
}
-/* note: call node_tree_verify_groups(snode->nodetree) after this
- */
-void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set)
+void node_set_hidden_sockets(SpaceNode *snode, bNode *node, short flag, int set)
{
bNodeSocket *sock;
if(set==0) {
for(sock= node->inputs.first; sock; sock= sock->next)
- sock->flag &= ~SOCK_HIDDEN;
+ sock->flag &= ~flag;
for(sock= node->outputs.first; sock; sock= sock->next)
- sock->flag &= ~SOCK_HIDDEN;
+ sock->flag &= ~flag;
}
else {
/* hide unused sockets */
for(sock= node->inputs.first; sock; sock= sock->next) {
if(sock->link==NULL)
- sock->flag |= SOCK_HIDDEN;
+ sock->flag |= flag;
}
for(sock= node->outputs.first; sock; sock= sock->next) {
if(nodeCountSocketLinks(snode->edittree, sock)==0)
- sock->flag |= SOCK_HIDDEN;
+ sock->flag |= flag;
}
}
}
@@ -1680,14 +1678,14 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode)
/* find a socket after the previously connected socket */
for(sock=sock->next; sock; sock= sock->next)
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
+ if(!nodeSocketIsHidden(sock))
break;
}
/* find a socket starting from the first socket */
if(!sock) {
for(sock= tonode->outputs.first; sock; sock= sock->next)
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
+ if(!nodeSocketIsHidden(sock))
break;
}
@@ -1805,7 +1803,7 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
if(in_out & SOCK_IN) {
for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+ if(!nodeSocketIsHidden(sock)) {
if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
if(node == visible_node(snode, &rect)) {
*nodep= node;
@@ -1818,7 +1816,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|SOCK_UNAVAIL))) {
+ if(!nodeSocketIsHidden(sock)) {
if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
if(node == visible_node(snode, &rect)) {
*nodep= node;
@@ -1836,7 +1834,7 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
*/
if(in_out & SOCK_IN) {
for(sock= snode->edittree->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+ if(!nodeSocketIsHidden(sock)) {
if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
*nodep= NULL; /* NULL node pointer indicates group socket */
*sockp= sock;
@@ -1847,7 +1845,7 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
}
if(in_out & SOCK_OUT) {
for(sock= snode->edittree->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+ if(!nodeSocketIsHidden(sock)) {
if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
*nodep= NULL; /* NULL node pointer indicates group socket */
*sockp= sock;
@@ -1930,13 +1928,12 @@ static int sort_nodes_locx(void *a, void *b)
static int socket_is_available(bNodeTree *ntree, bNodeSocket *sock, int allow_used)
{
- if (sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))
+ if (nodeSocketIsHidden(sock))
+ return 0;
+
+ if (!allow_used && (sock->flag & SOCK_IN_USE))
return 0;
- if (!allow_used) {
- if (nodeCountSocketLinks(ntree, sock) > 0)
- return 0;
- }
return 1;
}
@@ -2246,7 +2243,7 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL
}
if(sock) {
tlink->tosock= sock;
- sock->flag &= ~SOCK_HIDDEN;
+ sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
}
else {
nodeRemLink(snode->edittree, tlink);
@@ -2644,26 +2641,26 @@ static bNodeSocket *socket_best_match(ListBase *sockets, int type)
/* first, match type */
for(sock= sockets->first; sock; sock= sock->next)
- if(!(sock->flag & SOCK_HIDDEN))
+ if(!nodeSocketIsHidden(sock))
if(type == sock->type)
return sock;
/* then just use first unhidden socket */
for(sock= sockets->first; sock; sock= sock->next)
- if(!(sock->flag & SOCK_HIDDEN))
+ if(!nodeSocketIsHidden(sock))
return sock;
/* OK, let's unhide proper one */
for(sock= sockets->first; sock; sock= sock->next) {
if(type == sock->type) {
- sock->flag &= ~SOCK_HIDDEN;
+ sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
return sock;
}
}
/* just the first */
sock= sockets->first;
- sock->flag &= ~SOCK_HIDDEN;
+ sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
return sockets->first;
}
@@ -3003,10 +3000,20 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag)
if(toggle_flag== NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS)==0)
continue;
- if( (tot_eq && tot_neq) || tot_eq==0)
+ if( (tot_eq && tot_neq) || tot_eq==0) {
node->flag |= toggle_flag;
- else
+
+ /* hide/unhide node also toggles unlinked socket display */
+ if (toggle_flag== NODE_HIDDEN)
+ node_set_hidden_sockets(snode, node, SOCK_AUTO_HIDDEN, 1);
+ }
+ else {
node->flag &= ~toggle_flag;
+
+ /* hide/unhide node also toggles unlinked socket display */
+ if (toggle_flag== NODE_HIDDEN)
+ node_set_hidden_sockets(snode, node, SOCK_AUTO_HIDDEN, 0);
+ }
}
}
}
@@ -3119,7 +3126,7 @@ static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
hidden = 0;
for(node= snode->edittree->nodes.first; node; node= node->next) {
if(node->flag & SELECT) {
- if(node_has_hidden_sockets(node)) {
+ if(node_has_hidden_sockets(node, SOCK_HIDDEN)) {
hidden= 1;
break;
}
@@ -3128,7 +3135,7 @@ static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
for(node= snode->edittree->nodes.first; node; node= node->next) {
if(node->flag & SELECT) {
- node_set_hidden_sockets(snode, node, !hidden);
+ node_set_hidden_sockets(snode, node, SOCK_HIDDEN, !hidden);
}
}
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 9068493360e..186ad3768be 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -118,8 +118,8 @@ void snode_composite_job(const struct bContext *C, ScrArea *sa);
bNode *node_tree_get_editgroup(bNodeTree *ntree);
void node_tree_verify_groups(bNodeTree *nodetree);
void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace);
-int node_has_hidden_sockets(bNode *node);
-void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set);
+int node_has_hidden_sockets(bNode *node, short flag);
+void node_set_hidden_sockets(SpaceNode *snode, bNode *node, short flag, int set);
int node_render_changed_exec(bContext *, wmOperator *);
void NODE_OT_duplicate(struct wmOperatorType *ot);
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index c2e1183415c..996bfd35581 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -426,14 +426,6 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *col, flo
* @attention defined in readimage.c
* @deprecated Only here for backwards compatibility of the
* @deprecated plugin system.
- */
-struct ImBuf *IMB_loadiffmem(int *mem, int flags);
-
-/**
- *
- * @attention defined in readimage.c
- * @deprecated Only here for backwards compatibility of the
- * @deprecated plugin system.
*/
struct ImBuf *IMB_loadifffile(int file, int flags, const char *descr);
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index aa9b43584fd..e2d612169e7 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -129,6 +129,8 @@ typedef struct bNodeSocket {
#define SOCK_COLLAPSED 64
/* hide socket value, if it gets auto default */
#define SOCK_HIDE_VALUE 128
+ /* socket hidden automatically, to distinguish from manually hidden */
+#define SOCK_AUTO_HIDDEN 256
typedef struct bNodePreview {
unsigned char *rect;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 529bea38632..97770f83a7a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3442,14 +3442,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop,0.0,1.0);
- RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
+ RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop,0.0,1.0);
- RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
+ RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* sequencer draw options */
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index c8792ef30f3..fa1f6c72430 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -54,6 +54,7 @@ EnumPropertyItem region_type_items[] = {
#ifdef RNA_RUNTIME
+#include "BKE_global.h"
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{
@@ -62,7 +63,6 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
if(value.data == NULL)
return;
- /* exception: can't set screens inside of area/region handers */
sc->newscene= value.data;
}
@@ -70,10 +70,14 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
{
bScreen *sc= (bScreen*)ptr->data;
- /* exception: can't set screens inside of area/region handers, and must
- use context so notifier gets to the right window */
+ /* exception: must use context so notifier gets to the right window */
if(sc->newscene) {
+ ED_screen_set_scene(C, sc->newscene);
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
+
+ if(G.f & G_DEBUG)
+ printf("scene set %p\n", sc->newscene);
+
sc->newscene= NULL;
}
}
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 5ad84da45d2..fdce1f92948 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -609,7 +609,7 @@ void node_group_expose_all_sockets(bNodeTree *ngroup)
for (node=ngroup->nodes.first; node; node=node->next) {
for (sock=node->inputs.first; sock; sock=sock->next) {
- if (!sock->link && !(sock->flag & SOCK_HIDDEN)) {
+ if (!sock->link && !nodeSocketIsHidden(sock)) {
gsock = node_group_add_socket(ngroup, sock->name, sock->type, SOCK_IN);
/* initialize the default value. */
@@ -619,7 +619,7 @@ void node_group_expose_all_sockets(bNodeTree *ngroup)
}
}
for (sock=node->outputs.first; sock; sock=sock->next) {
- if (nodeCountSocketLinks(ngroup, sock)==0 && !(sock->flag & SOCK_HIDDEN)) {
+ if (nodeCountSocketLinks(ngroup, sock)==0 && !nodeSocketIsHidden(sock)) {
gsock = node_group_add_socket(ngroup, sock->name, sock->type, SOCK_OUT);
/* initialize the default value. */
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 8b8afc3d846..1bfb986fdde 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -184,7 +184,7 @@ void nodeShaderSynchronizeID(bNode *node, int copyto)
/* hrmf, case in loop isnt super fast, but we dont edit 100s of material at same time either! */
for(a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
- if(!(sock->flag & SOCK_HIDDEN)) {
+ if(!nodeSocketIsHidden(sock)) {
if(copyto) {
switch(a) {
case MAT_IN_COLOR:
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 2add53a86a6..1d238015e21 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -53,7 +53,6 @@
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_node.h"
-#include "BKE_object.h"
#include "BKE_pointcache.h"
#include "BKE_report.h"
#include "BKE_scene.h"
@@ -62,11 +61,12 @@
#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */
#include "BLI_math.h"
-#include "BLI_blenlib.h"
+#include "BLI_listbase.h"
+#include "BLI_string.h"
+#include "BLI_path_util.h"
+#include "BLI_fileops.h"
#include "BLI_rand.h"
-#include "BLI_threads.h"
#include "BLI_callbacks.h"
-#include "BLI_utildefines.h"
#include "PIL_time.h"
#include "IMB_imbuf.h"
@@ -81,7 +81,6 @@
#include "renderpipeline.h"
#include "renderdatabase.h"
#include "rendercore.h"
-#include "envmap.h"
#include "initrender.h"
#include "shadbuf.h"
#include "pixelblending.h"
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 42ad5fd15e5..f9ffc2532eb 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -780,7 +780,10 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
tracol[3]= col[3]; // we pass on and accumulate alpha
if((shi.mat->mode & MA_TRANSP) && (shi.mat->mode & MA_RAYTRANSP)) {
- if(traflag & RAY_INSIDE) {
+ /* don't overwrite traflag, it's value is used in mirror reflection */
+ int new_traflag = traflag;
+
+ if(new_traflag & RAY_INSIDE) {
/* inside the material, so use inverse normal */
float norm[3];
norm[0]= - shi.vn[0];
@@ -789,7 +792,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
if (refraction(refract, norm, shi.view, shi.ang)) {
/* ray comes out from the material into air */
- traflag &= ~RAY_INSIDE;
+ new_traflag &= ~RAY_INSIDE;
}
else {
/* total internal reflection (ray stays inside the material) */
@@ -799,14 +802,14 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
else {
if (refraction(refract, shi.vn, shi.view, shi.ang)) {
/* ray goes in to the material from air */
- traflag |= RAY_INSIDE;
+ new_traflag |= RAY_INSIDE;
}
else {
/* total external reflection (ray doesn't enter the material) */
reflection(refract, shi.vn, shi.view, shi.vn);
}
}
- traceray(origshi, origshr, depth-1, shi.co, refract, tracol, shi.obi, shi.vlr, traflag);
+ traceray(origshi, origshr, depth-1, shi.co, refract, tracol, shi.obi, shi.vlr, new_traflag);
}
else
traceray(origshi, origshr, depth-1, shi.co, shi.view, tracol, shi.obi, shi.vlr, 0);
@@ -840,7 +843,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
float ref[3];
reflection_simple(ref, shi.vn, shi.view);
- traceray(origshi, origshr, depth-1, shi.co, ref, mircol, shi.obi, shi.vlr, 0);
+ traceray(origshi, origshr, depth-1, shi.co, ref, mircol, shi.obi, shi.vlr, traflag);
f1= 1.0f-f;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 43a691770c9..43ed2b3b2b9 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -225,20 +225,8 @@ void wm_event_do_notifiers(bContext *C)
if(note->window==win || (note->window == NULL && (note->reference == NULL || note->reference == CTX_data_scene(C)))) {
if(note->category==NC_SCENE) {
- if(note->data==ND_SCENEBROWSE) {
- ED_screen_set_scene(C, note->reference); // XXX hrms, think this over!
- if(G.f & G_DEBUG)
- printf("scene set %p\n", note->reference);
- }
- else if(note->data==ND_FRAME)
+ if(note->data==ND_FRAME)
do_anim= 1;
-
- if(note->action == NA_REMOVED) {
- ED_screen_delete_scene(C, note->reference); // XXX hrms, think this over!
- if(G.f & G_DEBUG)
- printf("scene delete %p\n", note->reference);
- }
-
}
}
if(ELEM5(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE, NC_WM)) {