44 const bNode &
node,
const bool use_meta_data)
66 if (session ==
nullptr) {
104 switch (
node.custom1) {
120 if (entry->encoded_hash == encoded_hash) {
160 {
SOCK_RGBA,
N_(
"Image"), 0.0f, 0.0f, 0.0f, 1.0f}, {-1,
""}};
202 layer_name.copy(layer->
name);
217 std::string first_layer_name;
222 if (first_layer_name.empty()) {
223 first_layer_name = layer_name;
226 if (layer_name == node_cryptomatte->
layer_name) {
233 const char *cstr = first_layer_name.c_str();
241 return session_ptr.release();
248 node->storage = user;
274 const bNode *src_node)
286 const char **r_disabled_hint)
299 if (
scene ==
nullptr) {
301 "The node tree must be the compositing node tree of any scene in the file";
303 return scene !=
nullptr;
305 *r_disabled_hint =
"Not a compositor node tree";
struct Scene * CTX_data_scene(const bContext *C)
bool BKE_cryptomatte_find_name(const struct CryptomatteSession *session, const float encoded_hash, char *r_name, int name_len)
struct CryptomatteSession * BKE_cryptomatte_init_from_render_result(const struct RenderResult *render_result)
struct CryptomatteSession * BKE_cryptomatte_init_from_scene(const struct Scene *scene)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_image_user_frame_calc(struct Image *ima, struct ImageUser *iuser, int cfra)
void id_us_plus(struct ID *id)
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
struct bNodeSocket * nodeAddStaticSocket(struct bNodeTree *ntree, struct bNode *node, eNodeSocketInOut in_out, int type, int subtype, const char *identifier, const char *name)
#define CMP_NODE_CRYPTOMATTE_LEGACY
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock)
#define CMP_CRYPTOMATTE_SRC_RENDER
#define CMP_CRYPTOMATTE_SRC_IMAGE
void nodeRegisterType(struct bNodeType *ntype)
A dynamically sized string ADT.
#define LISTBASE_FOREACH(type, var, list)
void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE void zero_v3(float r[3])
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner CMP_NODE_CRYPTOMATTE
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
std::unique_ptr< CryptomatteSession, CryptomatteSessionDeleter > CryptomatteSessionPtr
const blender::Vector< std::string > & BKE_cryptomatte_layer_names_get(const CryptomatteSession &session)
static void node_copy_cryptomatte(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
CryptomatteSession * ntreeCompositCryptomatteSession(const Scene *scene, bNode *node)
static void node_init_api_cryptomatte(const bContext *C, PointerRNA *ptr)
static bool node_poll_cryptomatte(bNodeType *UNUSED(ntype), bNodeTree *ntree, const char **r_disabled_hint)
static blender::bke::cryptomatte::CryptomatteSessionPtr cryptomatte_init_from_node_image(const Scene &scene, const bNode &node)
static bNodeSocketTemplate cmp_node_cryptomatte_in[]
void register_node_type_cmp_cryptomatte_legacy(void)
static blender::bke::cryptomatte::CryptomatteSessionPtr cryptomatte_init_from_node_render(const bNode &node, const bool use_meta_data)
static bNodeSocketTemplate cmp_node_cryptomatte_out[]
static void node_init_cryptomatte_legacy(bNodeTree *ntree, bNode *node)
static blender::bke::cryptomatte::CryptomatteSessionPtr cryptomatte_init_from_node(const Scene &scene, const bNode &node, const bool use_meta_data)
void ntreeCompositCryptomatteLayerPrefix(const Scene *scene, const bNode *node, char *r_prefix, size_t prefix_len)
int ntreeCompositCryptomatteRemoveSocket(bNodeTree *ntree, bNode *node)
void ntreeCompositCryptomatteSyncFromRemove(bNode *node)
static CryptomatteEntry * cryptomatte_find(const NodeCryptomatte &n, float encoded_hash)
void ntreeCompositCryptomatteSyncFromAdd(const Scene *scene, bNode *node)
void register_node_type_cmp_cryptomatte(void)
static void cryptomatte_remove(NodeCryptomatte &n, float encoded_hash)
static void node_free_cryptomatte(bNode *node)
bNodeSocket * ntreeCompositCryptomatteAddSocket(bNodeTree *ntree, bNode *node)
static void cryptomatte_add(const Scene &scene, bNode &node, NodeCryptomatte &node_cryptomatte, float encoded_hash)
static void node_init_cryptomatte(bNodeTree *UNUSED(ntree), bNode *node)
void ntreeCompositCryptomatteUpdateLayerNames(const Scene *scene, bNode *node)
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
RenderResult * RE_AcquireResultRead(Render *re)
Render * RE_GetSceneRender(const Scene *scene)
void RE_ReleaseResult(Render *re)
NodeCryptomatte_Runtime runtime
struct bNodeTree * nodetree
Compact definition of a node socket.
bool(* poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char **r_disabled_hint)
void(* initfunc_api)(const struct bContext *C, struct PointerRNA *ptr)