57 return sizeof(ustring);
63 return sizeof(
void *);
101 return &zero_transform;
106 static const ustring names[] = {ustring(
"undefined"),
108 ustring(
"boolean"), ustring(
"float"),
109 ustring(
"int"), ustring(
"uint"),
110 ustring(
"uint64"), ustring(
"color"),
111 ustring(
"vector"), ustring(
"point"),
112 ustring(
"normal"), ustring(
"point2"),
113 ustring(
"closure"), ustring(
"string"),
114 ustring(
"enum"), ustring(
"transform"),
117 ustring(
"array_boolean"), ustring(
"array_float"),
118 ustring(
"array_int"), ustring(
"array_color"),
119 ustring(
"array_vector"), ustring(
"array_point"),
120 ustring(
"array_normal"), ustring(
"array_point2"),
121 ustring(
"array_string"), ustring(
"array_transform"),
122 ustring(
"array_node")};
124 constexpr size_t num_names =
sizeof(names) /
sizeof(*names);
127 return names[(int)
type];
151 const int struct_offset,
152 const void *default_value,
156 const int extra_flags)
166 socket.
flags = flags | extra_flags;
189 if (socket.name ==
name) {
200 if (socket.name ==
name) {
227static unordered_map<ustring, NodeType> &
types()
229 static unordered_map<ustring, NodeType> _types;
236 return types_on_init_mutex_;
241 static std::vector<
const NodeType *(*)()> _types_on_init;
242 return _types_on_init;
263 const ustring
name(name_);
269 LOG_ERROR <<
"Node type " << name_ <<
" registered twice";
287 const unordered_map<ustring, NodeType>::iterator it =
types().find(
name);
288 return (it ==
types().end()) ? nullptr : &it->second;
297 for (
const auto &pair :
types()) {
298 names.push_back(pair.first);
unsigned long long int uint64_t
#define CCL_NAMESPACE_END
#define assert(assertion)
static unordered_map< ustring, NodeType > & types()
static thread_mutex & types_on_init_mutex()
static thread_mutex & types_mutex()
static void ensure_types_initialized()
static std::vector< const NodeType *(*)()> & types_on_init()
std::bitset< 128 > SocketModifiedFlags
static PyObject * init_func(PyObject *, PyObject *args)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
vector< SocketType, std::allocator< SocketType > > inputs
NodeType(Type type=NONE, const NodeType *base=nullptr)
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=nullptr)
unique_ptr< Node >(*)(const NodeType *) CreateFunc
const SocketType * find_output(ustring name) const
static const NodeType * find(ustring name)
void register_input(ustring name, ustring ui_name, SocketType::Type type, const int struct_offset, const void *default_value, const NodeEnum *enum_values=nullptr, const NodeType *node_type=nullptr, int flags=0, int extra_flags=0)
static vector< ustring > type_names()
static bool register_on_init(const NodeType *(*init_func)())
void register_output(ustring name, ustring ui_name, SocketType::Type type)
const SocketType * find_input(ustring name) const
vector< SocketType, std::allocator< SocketType > > outputs
static size_t size(Type type, bool packed)
const void * default_value
const NodeType * node_type
size_t storage_size() const
static bool is_float3(Type type)
static ustring type_name(Type type)
static void * zero_default_value()
const NodeEnum * enum_values
uint8_t modified_flag_bit
size_t packed_size() const
std::unique_lock< std::mutex > thread_scoped_lock