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:
authorThomas Dinges <blender@dingto.org>2009-09-20 17:34:54 +0400
committerThomas Dinges <blender@dingto.org>2009-09-20 17:34:54 +0400
commit7d86e92df9d92fe7c2fe7dc144b113dcc8436578 (patch)
treed3c3f28dd69ee5772c9d09d8661486e09787347a /source/blender
parent2f71b49484ee2c45d77784d07a21031d07f699ed (diff)
2.5:
* Wrapped Invert, PremulKey Levels Node, Distance Key, Difference Key and Color Spill. * Added RNA for Levels Node. * Small RNA fixes.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_node/drawnode.c106
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c26
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h4
3 files changed, 46 insertions, 90 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 3fa1e43b51b..9b73bdbb255 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1294,7 +1294,6 @@ static void node_composit_buts_lensdist(uiLayout *layout, PointerRNA *ptr)
uiLayoutSetActive(col, RNA_boolean_get(ptr, "projector")==0);
uiItemR(col, NULL, 0, ptr, "jitter", 0);
uiItemR(col, NULL, 0, ptr, "fit", 0);
-
}
static void node_composit_buts_vecblur(uiLayout *layout, PointerRNA *ptr)
@@ -1395,60 +1394,30 @@ static void node_composit_buts_dilateerode(uiLayout *layout, PointerRNA *ptr)
static void node_composit_buts_diff_matte(uiLayout *layout, PointerRNA *ptr)
{
- uiBlock *block= uiLayoutFreeBlock(layout);
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
- NodeChroma *c= node->storage;
+ uiLayout *col;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Tolerance: ",
- butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20,
- &c->t1, 0.0f, 1.0f, 100, 0, "Color differences below this threshold are keyed.");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Falloff: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &c->t2, 0.0f, 1.0f, 100, 0, "Color differences below this additional threshold are partially keyed.");
- uiBlockEndAlign(block);
+ col =uiLayoutColumn(layout, 1);
+ uiItemR(col, NULL, 0, ptr, "tolerance", UI_ITEM_R_SLIDER);
+ uiItemR(col, NULL, 0, ptr, "falloff", UI_ITEM_R_SLIDER);
}
static void node_composit_buts_distance_matte(uiLayout *layout, PointerRNA *ptr)
{
- uiBlock *block= uiLayoutFreeBlock(layout);
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
- NodeChroma *c= node->storage;
+ uiLayout *col;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Tolerance: ",
- butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20,
- &c->t1, 0.0f, 1.0f, 100, 0, "Color distances below this threshold are keyed.");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Falloff: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &c->t2, 0.0f, 1.0f, 100, 0, "Color distances below this additional threshold are partially keyed.");
- uiBlockEndAlign(block);
+ col =uiLayoutColumn(layout, 1);
+ uiItemR(col, NULL, 0, ptr, "tolerance", UI_ITEM_R_SLIDER);
+ uiItemR(col, NULL, 0, ptr, "falloff", UI_ITEM_R_SLIDER);
}
static void node_composit_buts_color_spill(uiLayout *layout, PointerRNA *ptr)
{
- uiBlock *block= uiLayoutFreeBlock(layout);
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
- short dx= (butr->xmax-butr->xmin)/3;
-
- NodeChroma *c=node->storage;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC, "Enhance: ",
- butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20,
- &c->t1, 0.0f, 0.5f, 100, 2, "Adjusts how much selected channel is affected by color spill algorithm");
- uiDefButS(block, ROW, B_NODE_EXEC, "R",
- butr->xmin,butr->ymin,dx,20,
- &node->custom1,1,1, 0, 0, "Red Spill Suppression");
- uiDefButS(block, ROW, B_NODE_EXEC, "G",
- butr->xmin+dx,butr->ymin,dx,20,
- &node->custom1,1,2, 0, 0, "Green Spill Suppression");
- uiDefButS(block, ROW, B_NODE_EXEC, "B",
- butr->xmin+2*dx,butr->ymin,dx,20,
- &node->custom1, 1, 3, 0, 0, "Blue Spill Suppression");
- uiBlockEndAlign(block);
+ uiLayout *row, *col;
+
+ col =uiLayoutColumn(layout, 1);
+ uiItemR(col, NULL, 0, ptr, "factor", 0);
+ row= uiLayoutRow(col, 0);
+ uiItemR(row, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND);
}
static void node_composit_buts_chroma_matte(uiLayout *layout, PointerRNA *ptr)
@@ -1709,56 +1678,23 @@ static void node_composit_buts_scale(uiLayout *layout, PointerRNA *ptr)
static void node_composit_buts_invert(uiLayout *layout, PointerRNA *ptr)
{
- uiBlock *block= uiLayoutFreeBlock(layout);
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, CMP_CHAN_RGB, B_NODE_EXEC, "RGB",
- butr->xmin, butr->ymin, (butr->xmax-butr->xmin)/2, 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiDefButBitS(block, TOG, CMP_CHAN_A, B_NODE_EXEC, "A",
- butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin, (butr->xmax-butr->xmin)/2, 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiBlockEndAlign(block);
+ uiLayout *col;
+
+ col= uiLayoutColumn(layout, 0);
+ uiItemR(col, NULL, 0, ptr, "rgb", 0);
+ uiItemR(col, NULL, 0, ptr, "alpha", 0);
}
static void node_composit_buts_premulkey(uiLayout *layout, PointerRNA *ptr)
{
- uiBlock *block= uiLayoutFreeBlock(layout);
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
- uiBut *bt;
-
- /* blend type */
- bt=uiDefButS(block, MENU, B_NODE_EXEC, "Key to Premul %x0|Premul to Key %x1",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 0, 0, 0, "Conversion between premultiplied alpha and key alpha");
+ uiItemR(layout, "", 0, ptr, "mapping", 0);
}
static void node_composit_buts_view_levels(uiLayout *layout, PointerRNA *ptr)
{
- uiBlock *block= uiLayoutFreeBlock(layout);
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
- short sx= (butr->xmax-butr->xmin)/5;
-
- /*color space selectors*/
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"C",
- butr->xmin,butr->ymin,sx,20,&node->custom1,1,1, 0, 0, "Combined RGB");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"R",
- butr->xmin+sx,butr->ymin,sx,20,&node->custom1,1,2, 0, 0, "Red Channel");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"G",
- butr->xmin+2*sx,butr->ymin,sx,20,&node->custom1,1,3, 0, 0, "Green Channel");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"B",
- butr->xmin+3*sx,butr->ymin,sx,20,&node->custom1,1,4, 0, 0, "Blue Channel");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"L",
- butr->xmin+4*sx,butr->ymin,sx,20,&node->custom1,1,5, 0, 0, "Luminenc Channel");
- uiBlockEndAlign(block);
+ uiItemR(layout, NULL, 0, ptr, "color_space", UI_ITEM_R_EXPAND);
}
-
/* only once called */
static void node_composit_set_butfunc(bNodeType *ntype)
{
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index b89bf0552bd..239fd894e4f 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -700,6 +700,26 @@ static void def_cmp_vector_blur(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Node_update");
}
+static void def_cmp_levels(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem space_items[] = {
+ {1, "COMNINED_RGB", 0, "C", "Combined RGB"},
+ {2, "RED", 0, "R", "Red Channel"},
+ {3, "GREEN", 0, "G", "Green Channel"},
+ {4, "BLUE", 0, "B", "Blue Channel"},
+ {5, "LUMINANCE", 0, "L", "Luminance Channel"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, space_items);
+ RNA_def_property_ui_text(prop, "Color Space", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+}
+
static void def_cmp_image(StructRNA *srna)
{
PropertyRNA *prop;
@@ -964,9 +984,9 @@ static void def_cmp_color_spill(StructRNA *srna)
PropertyRNA *prop;
static EnumPropertyItem channel_items[] = {
- {1, "R", 0, "Red", ""},
- {2, "G", 0, "Green", ""},
- {3, "B", 0, "Blue", ""},
+ {1, "R", 0, "R", "Red Spill Suppression"},
+ {2, "G", 0, "G", "Green Spill Suppression"},
+ {3, "B", 0, "B", "Blue Spill Suppression"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index 420f1deae48..69424649b3b 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -64,7 +64,7 @@ DefNode( CompositorNode, CMP_NODE_VECBLUR, def_cmp_vector_blur, "VECBL
DefNode( CompositorNode, CMP_NODE_SEPRGBA, 0, "SEPRGBA", SepRGBA, "Separate RGBA", "" )
DefNode( CompositorNode, CMP_NODE_SEPHSVA, 0, "SEPHSVA", SepHSVA, "Separate HSVA", "" )
DefNode( CompositorNode, CMP_NODE_SETALPHA, 0, "SETALPHA", SetAlpha, "Set Alpha", "" )
-DefNode( CompositorNode, CMP_NODE_HUE_SAT, def_cmp_hue_saturation, "HUE_SAT", HueSat, "Hue/Saturation", "" )
+DefNode( CompositorNode, CMP_NODE_HUE_SAT, def_cmp_hue_saturation, "HUE_SAT", HueSat, "Hue/Saturation", "" )
DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE", Image, "Image", "" )
DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" )
DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" )
@@ -104,7 +104,7 @@ DefNode( CompositorNode, CMP_NODE_PREMULKEY, def_cmp_premul_key, "PREMU
DefNode( CompositorNode, CMP_NODE_GLARE, def_cmp_glare, "GLARE", Glare, "Glare", "" )
DefNode( CompositorNode, CMP_NODE_TONEMAP, def_cmp_tonemap, "TONEMAP", Tonemap, "Tonemap", "" )
DefNode( CompositorNode, CMP_NODE_LENSDIST, def_cmp_lensdist, "LENSDIST", Lensdist, "Lensdist", "" )
-DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, 0, "LEVELS", Levels, "Levels", "" )
+DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, def_cmp_levels, "LEVELS", Levels, "Levels", "" )
DefNode( CompositorNode, CMP_NODE_COLOR_MATTE, def_cmp_color_matte, "COLOR_MATTE", ColorMatte, "Color Matte", "" )
DefNode( CompositorNode, CMP_NODE_DIST_MATTE, def_cmp_distance_matte, "DISTANCE_MATTE", DistanceMatte, "Distance Matte", "" )