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:
parent
ea67f55b87
commit
f1555c8bba
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue