Bug fix: copying a scene, choosing 'empty scene' did a corrupt copy of the
scene render layers Little feat: Render Result Nodes that use other scene, have icon in button to indicate this.
This commit is contained in:
@@ -231,6 +231,7 @@ Scene *add_scene(char *name)
|
||||
BLI_init_rctf(&sce->r.safety, 0.1f, 0.9f, 0.1f, 0.9f);
|
||||
sce->r.osa= 8;
|
||||
|
||||
/* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */
|
||||
scene_add_render_layer(sce);
|
||||
|
||||
return sce;
|
||||
|
||||
@@ -445,6 +445,7 @@ typedef struct Scene {
|
||||
#define R_DOCOMP 0x0040
|
||||
#define R_COMP_CROP 0x0080
|
||||
#define R_FREE_IMAGE 0x0100
|
||||
#define R_SINGLE_LAYER 0x0200
|
||||
|
||||
/* alphamode */
|
||||
#define R_ADDSKY 0
|
||||
|
||||
@@ -1847,7 +1847,9 @@ static void render_panel_layers(void)
|
||||
uiDefButS(block, MENU, B_ADD_RENDERLAYER, strp, 10,130,23,20, &(G.scene->r.actlay), 0, 0, 0, 0, "Choose Active Render Layer");
|
||||
MEM_freeN(strp);
|
||||
|
||||
bt= uiDefBut(block, TEX, REDRAWNODE, "", 33,130,252,20, srl->name, 0.0, 31.0, 0, 0, "");
|
||||
uiDefButBitS(block, TOG, R_SINGLE_LAYER, B_NOP, "Single", 33,130,50,20, &G.scene->r.scemode, 0, 0, 0, 0, "Only render this layer");
|
||||
|
||||
bt= uiDefBut(block, TEX, REDRAWNODE, "", 83,130,202,20, srl->name, 0.0, 31.0, 0, 0, "");
|
||||
uiButSetFunc(bt, rename_scene_layer_func, srl, NULL);
|
||||
bt=uiDefIconBut(block, BUT, B_NOP, ICON_X, 285, 130, 25, 20, 0, 0, 0, 0, 0, "Deletes current Render Layer");
|
||||
uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(long)G.scene->r.actlay);
|
||||
|
||||
@@ -694,7 +694,7 @@ static void set_render_result_title(void *node_v, void *unused)
|
||||
static char *scene_layer_menu(Scene *sce)
|
||||
{
|
||||
SceneRenderLayer *srl;
|
||||
int len= 32 + 32*BLI_countlist(&sce->r.layers);
|
||||
int len= 40 + 40*BLI_countlist(&sce->r.layers);
|
||||
short a, nr;
|
||||
char *str= MEM_callocN(len, "menu layers");
|
||||
|
||||
@@ -754,9 +754,15 @@ static int node_composit_buts_renderresult(uiBlock *block, bNodeTree *ntree, bNo
|
||||
|
||||
/* browse button layer */
|
||||
strp= scene_layer_menu(node->id?(Scene *)node->id:G.scene);
|
||||
if(node->id)
|
||||
bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC+node->nr, ICON_SCENE_DEHLT, strp,
|
||||
butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-20, 19,
|
||||
&node->custom1, 0, 0, 0, 0, "Choose Render Layer");
|
||||
else
|
||||
bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp,
|
||||
butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-20, 19,
|
||||
&node->custom1, 0, 0, 0, 0, "Choose Render Layer");
|
||||
|
||||
uiButSetFunc(bt, set_render_result_title, node, NULL);
|
||||
MEM_freeN(strp);
|
||||
}
|
||||
|
||||
@@ -717,7 +717,6 @@ static void transform_nodes(bNodeTree *ntree, char mode, char *undostr)
|
||||
|
||||
getmouseco_areawin(mval);
|
||||
if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) {
|
||||
// char str[64];
|
||||
|
||||
firsttime= 0;
|
||||
|
||||
@@ -733,8 +732,6 @@ static void transform_nodes(bNodeTree *ntree, char mode, char *undostr)
|
||||
}
|
||||
}
|
||||
|
||||
// sprintf(str, "X: %.1f Y: %.1f", mx-mxstart, my-mystart);
|
||||
// headerprint(str);
|
||||
force_draw(0);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -458,8 +458,13 @@ void do_info_buttons(unsigned short event)
|
||||
nr= pupmenu("Add scene%t|Empty|Link Objects|Link ObData|Full Copy");
|
||||
if(nr<= 0) return;
|
||||
if(nr==1) {
|
||||
ListBase lb;
|
||||
|
||||
sce= add_scene(G.scene->id.name+2);
|
||||
/* pretty bad ass copying here. we should use copy_scene to do all (ton) */
|
||||
lb= sce->r.layers;
|
||||
sce->r= G.scene->r;
|
||||
sce->r.layers= lb;
|
||||
#ifdef _WIN32
|
||||
if (sce->r.avicodecdata) {
|
||||
sce->r.avicodecdata = MEM_dupallocN(G.scene->r.avicodecdata);
|
||||
|
||||
@@ -1524,7 +1524,7 @@ static void ui_draw_text_icon(uiBut *but)
|
||||
if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) {
|
||||
ui_draw_icon(but, but->icon);
|
||||
|
||||
if(but->flag & UI_TEXT_LEFT) x= but->x1 + BIF_icon_get_width(but->icon)+4.0;
|
||||
if(but->flag & UI_TEXT_LEFT) x= but->x1 + but->aspect*BIF_icon_get_width(but->icon)+5.0;
|
||||
else x= (but->x1+but->x2-but->strwidth+1)/2.0;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user