22 return static_cast<const IntValue *
>(
this);
65 nlohmann::ordered_json json_item;
67 j.push_back(json_item);
78 nlohmann::ordered_json json_item;
86 switch (value.
type()) {
125 static std::unique_ptr<Value>
convert_from_json(
const nlohmann::ordered_json &j);
128 std::unique_ptr<ArrayValue>
array = std::make_unique<ArrayValue>();
130 for (
auto element : j.items()) {
131 nlohmann::ordered_json element_json =
element.value();
133 elements.append_as(value.release());
139 const nlohmann::ordered_json &j)
141 std::unique_ptr<DictionaryValue>
object = std::make_unique<DictionaryValue>();
143 for (
auto element : j.items()) {
144 std::string key =
element.key();
145 nlohmann::ordered_json element_json =
element.value();
147 elements.
append_as(std::pair(key, value.release()));
155 case nlohmann::json::value_t::array: {
159 case nlohmann::json::value_t::object: {
163 case nlohmann::json::value_t::string: {
164 std::string value = j;
165 return std::make_unique<StringValue>(value);
168 case nlohmann::json::value_t::null: {
169 return std::make_unique<NullValue>();
172 case nlohmann::json::value_t::boolean: {
173 return std::make_unique<BooleanValue>(j);
175 case nlohmann::json::value_t::number_integer:
176 case nlohmann::json::value_t::number_unsigned: {
177 return std::make_unique<IntValue>(j);
180 case nlohmann::json::value_t::number_float: {
181 return std::make_unique<DoubleValue>(j);
184 case nlohmann::json::value_t::binary:
185 case nlohmann::json::value_t::discarded:
193 return std::make_unique<NullValue>();
197 return std::make_unique<NullValue>();
202 nlohmann::ordered_json j;
214 nlohmann::ordered_json j;
#define BLI_assert_unreachable()
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color attribute
ATTR_WARN_UNUSED_RESULT const void * element
void append_as(ForwardValue &&...value)
const Container & elements() const
const std::string & value() const
const BooleanValue * as_boolean_value() const
const ArrayValue * as_array_value() const
const StringValue * as_string_value() const
const IntValue * as_int_value() const
const DoubleValue * as_double_value() const
const DictionaryValue * as_dictionary_value() const
static std::unique_ptr< ArrayValue > convert_from_json_to_array(const nlohmann::ordered_json &j)
static std::unique_ptr< Value > convert_from_json(const nlohmann::ordered_json &j)
static std::unique_ptr< DictionaryValue > convert_from_json_to_object(const nlohmann::ordered_json &j)
static void convert_to_json(nlohmann::ordered_json &j, const Value &value)