36 const bNode &
node,
const bool use_meta_data)
58 if (session ==
nullptr) {
96 switch (
node.custom1) {
112 if (entry->encoded_hash == encoded_hash) {
182 layer_name.copy(layer->
name);
197 std::string first_layer_name;
202 if (first_layer_name.empty()) {
203 first_layer_name = layer_name;
206 if (layer_name == node_cryptomatte->
layer_name) {
213 const char *cstr = first_layer_name.c_str();
221 return session_ptr.release();
227 {
SOCK_RGBA,
N_(
"Image"), 0.0f, 0.0f, 0.0f, 1.0f}, {-1,
""}};
239 node->storage = user;
266 const bNode *src_node)
279 const char **r_disabled_hint)
292 if (
scene ==
nullptr) {
293 *r_disabled_hint =
TIP_(
294 "The node tree must be the compositing node tree of any scene in the file");
296 return scene !=
nullptr;
298 *r_disabled_hint =
TIP_(
"Not a compositor node tree");
struct Scene * CTX_data_scene(const bContext *C)
struct CryptomatteSession * BKE_cryptomatte_init_from_render_result(const struct RenderResult *render_result)
struct CryptomatteSession * BKE_cryptomatte_init_from_scene(const struct Scene *scene)
bool BKE_cryptomatte_find_name(const struct CryptomatteSession *session, float encoded_hash, char *r_name, int name_len)
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)
#define CMP_NODE_CRYPTOMATTE
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])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
Read Guarded memory(de)allocation.
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
std::unique_ptr< CryptomatteSession, CryptomatteSessionDeleter > CryptomatteSessionPtr
const blender::Vector< std::string > & BKE_cryptomatte_layer_names_get(const CryptomatteSession &session)
static void node_init_api_cryptomatte(const bContext *C, PointerRNA *ptr)
static void node_init_cryptomatte(bNodeTree *UNUSED(ntree), bNode *node)
static bNodeSocketTemplate cmp_node_cryptomatte_in[]
static void node_free_cryptomatte(bNode *node)
static void node_copy_cryptomatte(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
static void node_init_cryptomatte_legacy(bNodeTree *ntree, bNode *node)
static bNodeSocketTemplate cmp_node_cryptomatte_out[]
static bool node_poll_cryptomatte(bNodeType *UNUSED(ntype), bNodeTree *ntree, const char **r_disabled_hint)
CryptomatteSession * ntreeCompositCryptomatteSession(const Scene *scene, bNode *node)
static blender::bke::cryptomatte::CryptomatteSessionPtr cryptomatte_init_from_node_image(const Scene &scene, const bNode &node)
void register_node_type_cmp_cryptomatte_legacy()
static blender::bke::cryptomatte::CryptomatteSessionPtr cryptomatte_init_from_node_render(const bNode &node, const bool use_meta_data)
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)
static void cryptomatte_remove(NodeCryptomatte &n, float encoded_hash)
void register_node_type_cmp_cryptomatte()
bNodeSocket * ntreeCompositCryptomatteAddSocket(bNodeTree *ntree, bNode *node)
static void cryptomatte_add(const Scene &scene, bNode &node, NodeCryptomatte &node_cryptomatte, float encoded_hash)
void ntreeCompositCryptomatteUpdateLayerNames(const Scene *scene, bNode *node)
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
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)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
void(* initfunc_api)(const struct bContext *C, struct PointerRNA *ptr)