Compositor: Use mask name as mask node label

This way it becomes much easier to navigate in roto compositor where it could
be 100s of masks in a production shot.
This commit is contained in:
Sergey Sharybin 2015-10-27 20:29:42 +05:00
parent ea67f55b87
commit f1555c8bba
1 changed files with 11 additions and 0 deletions

View File

@ -51,6 +51,16 @@ static void node_composit_init_mask(bNodeTree *UNUSED(ntree), bNode *node)
node->custom3 = 0.5f; /* shutter */
}
static void node_mask_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
{
if (node->id != NULL) {
BLI_strncpy(label, node->id->name + 2, maxlen);
}
else {
BLI_strncpy(label, IFACE_("Mask"), maxlen);
}
}
void register_node_type_cmp_mask(void)
{
static bNodeType ntype;
@ -58,6 +68,7 @@ void register_node_type_cmp_mask(void)
cmp_node_type_base(&ntype, CMP_NODE_MASK, "Mask", NODE_CLASS_INPUT, 0);
node_type_socket_templates(&ntype, NULL, cmp_node_mask_out);
node_type_init(&ntype, node_composit_init_mask);
node_type_label(&ntype, node_mask_label);
node_type_storage(&ntype, "NodeMask", node_free_standard_storage, node_copy_standard_storage);