Nodes: revert the inline (pass-through) socket feature #112560
|
@ -47,6 +47,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
|||
-DBUILD_SHARED_LIBS=ON
|
||||
${OPENIMAGEIO_LINKSTATIC}
|
||||
${DEFAULT_BOOST_FLAGS}
|
||||
-DREQUIRED_DEPS=WebP$<SEMICOLON>JPEGTurbo$<SEMICOLON>TIFF$<SEMICOLON>OpenEXR$<SEMICOLON>PNG$<SEMICOLON>OpenJPEG$<SEMICOLON>fmt$<SEMICOLON>Robinmap$<SEMICOLON>ZLIB$<SEMICOLON>pugixml$<SEMICOLON>Python
|
||||
-DUSE_LIBSQUISH=OFF
|
||||
-DUSE_QT5=OFF
|
||||
-DUSE_NUKE=OFF
|
||||
|
|
|
@ -1,31 +1,50 @@
|
|||
diff --git a/src/cmake/modules/FindWebP.cmake b/src/cmake/modules/FindWebP.cmake
|
||||
index 87b880a..0e9850f 100644
|
||||
--- a/src/cmake/modules/FindWebP.cmake
|
||||
+++ b/src/cmake/modules/FindWebP.cmake
|
||||
@@ -29,6 +29,12 @@ find_library (WEBPDEMUX_LIBRARY webpdemux
|
||||
diff -Naur oiio-2.4.15.0/src/cmake/modules/FindWebP.cmake external_openimageio/src/cmake/modules/FindWebP.cmake
|
||||
--- oiio-2.4.15.0/src/cmake/modules/FindWebP.cmake 2023-09-01 10:48:29.000000000 -0600
|
||||
+++ external_openimageio/src/cmake/modules/FindWebP.cmake 2023-09-21 14:47:19.366083900 -0600
|
||||
@@ -25,15 +25,30 @@
|
||||
ENV WEBP_INCLUDE_PATH
|
||||
DOC "The directory where Webp headers reside")
|
||||
|
||||
-find_library (WEBP_LIBRARY webp
|
||||
+find_library (WEBP_LIBRARY
|
||||
+ NAMES
|
||||
+ webp
|
||||
+ libwebp
|
||||
HINTS
|
||||
${WEBP_LIBRARY_PATH}
|
||||
ENV WEBP_LIBRARY_PATH)
|
||||
+# New in WebP 1.3
|
||||
+find_library (WEBP_SHARPYUV_LIBRARY sharpyuv
|
||||
-find_library (WEBPDEMUX_LIBRARY webpdemux
|
||||
+find_library (WEBPDEMUX_LIBRARY
|
||||
+ NAMES
|
||||
+ webpdemux
|
||||
+ libwebpdemux
|
||||
+ HINTS
|
||||
+ ${WEBP_LIBRARY_PATH}
|
||||
+ ENV WEBP_LIBRARY_PATH)
|
||||
+
|
||||
+# New in WebP 1.3
|
||||
+find_library (WEBP_SHARPYUV_LIBRARY
|
||||
+ NAMES
|
||||
+ sharpyuv
|
||||
+ libsharpyuv
|
||||
HINTS
|
||||
${WEBP_LIBRARY_PATH}
|
||||
ENV WEBP_LIBRARY_PATH)
|
||||
|
||||
+
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (WebP
|
||||
@@ -38,7 +44,7 @@ find_package_handle_standard_args (WebP
|
||||
REQUIRED_VARS WEBP_INCLUDE_DIR
|
||||
@@ -42,7 +57,7 @@
|
||||
|
||||
if (WebP_FOUND)
|
||||
set (WEBP_INCLUDES "${WEBP_INCLUDE_DIR}")
|
||||
- set (WEBP_LIBRARIES ${WEBP_LIBRARY} ${WEBPDEMUX_LIBRARY})
|
||||
+ set (WEBP_LIBRARIES ${WEBP_LIBRARY} ${WEBPDEMUX_LIBRARY} ${WEBP_SHARPYUV_LIBRARY})
|
||||
|
||||
if (NOT TARGET WebP::WebP)
|
||||
add_library(WebP::WebP UNKNOWN IMPORTED)
|
||||
@@ -54,10 +60,18 @@ if (WebP_FOUND)
|
||||
set_property(TARGET WebP::WebPDemux APPEND PROPERTY
|
||||
if (NOT TARGET WebP::webp)
|
||||
add_library(WebP::webp UNKNOWN IMPORTED)
|
||||
@@ -58,10 +73,18 @@
|
||||
set_property(TARGET WebP::webpdemux APPEND PROPERTY
|
||||
IMPORTED_LOCATION ${WEBPDEMUX_LIBRARY})
|
||||
endif ()
|
||||
+ if (WEBP_SHARPYUV_LIBRARY AND NOT TARGET WebP::sharpyuv)
|
||||
|
|
|
@ -208,10 +208,10 @@ template<typename Fn> bool socket_data_to_static_type(const eNodeSocketDatatype
|
|||
return false;
|
||||
}
|
||||
|
||||
template<typename Fn> bool socket_data_to_static_type(const char *socket_type, const Fn &fn)
|
||||
template<typename Fn> bool socket_data_to_static_type(const StringRef socket_type, const Fn &fn)
|
||||
{
|
||||
for (const bNodeSocketStaticTypeInfo &info : node_socket_subtypes) {
|
||||
if (STREQ(socket_type, info.socket_identifier)) {
|
||||
if (socket_type == info.socket_identifier) {
|
||||
return socket_data_to_static_type(info.type, fn);
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +233,8 @@ template<typename Fn> struct TypeTagExecutor {
|
|||
|
||||
} // namespace detail
|
||||
|
||||
template<typename Fn> void socket_data_to_static_type_tag(const char *socket_type, const Fn &fn)
|
||||
template<typename Fn>
|
||||
void socket_data_to_static_type_tag(const StringRef socket_type, const Fn &fn)
|
||||
{
|
||||
detail::TypeTagExecutor executor{fn};
|
||||
socket_data_to_static_type(socket_type, executor);
|
||||
|
@ -263,33 +264,16 @@ template<typename T> const T &get_socket_data_as(const bNodeTreeInterfaceSocket
|
|||
return *static_cast<const T *>(item.socket_data);
|
||||
}
|
||||
|
||||
inline bNodeTreeInterfaceSocket *add_interface_socket_from_node(bNodeTree &ntree,
|
||||
const bNode &from_node,
|
||||
const bNodeSocket &from_sock,
|
||||
const StringRefNull socket_type,
|
||||
const StringRefNull name)
|
||||
{
|
||||
NodeTreeInterfaceSocketFlag flag = NodeTreeInterfaceSocketFlag(0);
|
||||
SET_FLAG_FROM_TEST(flag, from_sock.in_out & SOCK_IN, NODE_INTERFACE_SOCKET_INPUT);
|
||||
SET_FLAG_FROM_TEST(flag, from_sock.in_out & SOCK_OUT, NODE_INTERFACE_SOCKET_OUTPUT);
|
||||
|
||||
bNodeTreeInterfaceSocket *iosock = ntree.tree_interface.add_socket(
|
||||
name.data(), from_sock.description, socket_type, flag, nullptr);
|
||||
if (iosock == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
const bNodeSocketType *typeinfo = iosock->socket_typeinfo();
|
||||
if (typeinfo->interface_from_socket) {
|
||||
typeinfo->interface_from_socket(&ntree.id, iosock, &from_node, &from_sock);
|
||||
UNUSED_VARS(from_sock);
|
||||
}
|
||||
return iosock;
|
||||
}
|
||||
bNodeTreeInterfaceSocket *add_interface_socket_from_node(bNodeTree &ntree,
|
||||
const bNode &from_node,
|
||||
const bNodeSocket &from_sock,
|
||||
const StringRef socket_type,
|
||||
const StringRef name);
|
||||
|
||||
inline bNodeTreeInterfaceSocket *add_interface_socket_from_node(bNodeTree &ntree,
|
||||
const bNode &from_node,
|
||||
const bNodeSocket &from_sock,
|
||||
const StringRefNull socket_type)
|
||||
const StringRef socket_type)
|
||||
{
|
||||
return add_interface_socket_from_node(ntree, from_node, from_sock, socket_type, from_sock.name);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ struct ID;
|
|||
struct ImBuf;
|
||||
struct PreviewImage;
|
||||
|
||||
void BKE_preview_images_init(void);
|
||||
void BKE_preview_images_free(void);
|
||||
void BKE_preview_images_init();
|
||||
void BKE_preview_images_free();
|
||||
|
||||
/**
|
||||
* Free the preview image for use in list.
|
||||
|
@ -63,7 +63,7 @@ void BKE_previewimg_id_free(ID *id);
|
|||
/**
|
||||
* Create a new preview image.
|
||||
*/
|
||||
PreviewImage *BKE_previewimg_create(void);
|
||||
PreviewImage *BKE_previewimg_create();
|
||||
|
||||
/**
|
||||
* Create a copy of the preview image.
|
||||
|
|
|
@ -2550,6 +2550,11 @@ static void *node_static_value_storage_for(bNode &node, const bNodeSocket &socke
|
|||
switch (node.type) {
|
||||
case FN_NODE_INPUT_BOOL:
|
||||
return &reinterpret_cast<NodeInputBool *>(node.storage)->boolean;
|
||||
case SH_NODE_VALUE:
|
||||
/* The value is stored in the default value of the first output socket. */
|
||||
return &static_cast<bNodeSocket *>(node.outputs.first)
|
||||
->default_value_typed<bNodeSocketValueFloat>()
|
||||
->value;
|
||||
case FN_NODE_INPUT_INT:
|
||||
return &reinterpret_cast<NodeInputInt *>(node.storage)->integer;
|
||||
case FN_NODE_INPUT_VECTOR:
|
||||
|
|
|
@ -38,9 +38,11 @@ namespace socket_types {
|
|||
* `NodeSocketFloatUnsigned`, `NodeSocketFloatFactor`. Only the "base type" (`NodeSocketFloat`)
|
||||
* is considered valid for interface sockets.
|
||||
*/
|
||||
static const char *try_get_supported_socket_type(StringRefNull socket_type)
|
||||
static const char *try_get_supported_socket_type(const StringRef socket_type)
|
||||
{
|
||||
const bNodeSocketType *typeinfo = nodeSocketTypeFind(socket_type.c_str());
|
||||
/* Make a copy of the string for `.c_str()` until the socket type map uses C++ types. */
|
||||
const std::string idname(socket_type);
|
||||
const bNodeSocketType *typeinfo = nodeSocketTypeFind(idname.c_str());
|
||||
if (typeinfo == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -170,7 +172,7 @@ template<> void socket_data_init_impl(bNodeSocketValueMaterial &data)
|
|||
data.value = nullptr;
|
||||
}
|
||||
|
||||
static void *make_socket_data(const char *socket_type)
|
||||
static void *make_socket_data(const StringRef socket_type)
|
||||
{
|
||||
void *socket_data = nullptr;
|
||||
socket_data_to_static_type_tag(socket_type, [&socket_data](auto type_tag) {
|
||||
|
@ -981,16 +983,18 @@ void bNodeTreeInterfacePanel::foreach_item(
|
|||
}
|
||||
}
|
||||
|
||||
namespace blender::bke::node_interface {
|
||||
|
||||
static bNodeTreeInterfaceSocket *make_socket(const int uid,
|
||||
blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
blender::StringRefNull socket_type,
|
||||
const StringRef name,
|
||||
const StringRef description,
|
||||
const StringRef socket_type,
|
||||
const NodeTreeInterfaceSocketFlag flag)
|
||||
{
|
||||
BLI_assert(name.c_str() != nullptr);
|
||||
BLI_assert(socket_type.c_str() != nullptr);
|
||||
|
||||
const char *idname = socket_types::try_get_supported_socket_type(socket_type.c_str());
|
||||
const char *idname = socket_types::try_get_supported_socket_type(socket_type);
|
||||
if (idname == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1001,32 +1005,61 @@ static bNodeTreeInterfaceSocket *make_socket(const int uid,
|
|||
/* Init common socket properties. */
|
||||
new_socket->identifier = BLI_sprintfN("Socket_%d", uid);
|
||||
new_socket->item.item_type = NODE_INTERFACE_SOCKET;
|
||||
new_socket->name = BLI_strdup(name.c_str());
|
||||
new_socket->description = BLI_strdup_null(description.c_str());
|
||||
new_socket->socket_type = BLI_strdup(socket_type.c_str());
|
||||
new_socket->name = BLI_strdupn(name.data(), name.size());
|
||||
new_socket->description = description.is_empty() ?
|
||||
nullptr :
|
||||
BLI_strdupn(description.data(), description.size());
|
||||
new_socket->socket_type = BLI_strdupn(socket_type.data(), socket_type.size());
|
||||
new_socket->flag = flag;
|
||||
|
||||
new_socket->socket_data = socket_types::make_socket_data(socket_type.c_str());
|
||||
new_socket->socket_data = socket_types::make_socket_data(socket_type);
|
||||
|
||||
return new_socket;
|
||||
}
|
||||
|
||||
bNodeTreeInterfaceSocket *add_interface_socket_from_node(bNodeTree &ntree,
|
||||
const bNode &from_node,
|
||||
const bNodeSocket &from_sock,
|
||||
const StringRef socket_type,
|
||||
const StringRef name)
|
||||
{
|
||||
NodeTreeInterfaceSocketFlag flag = NodeTreeInterfaceSocketFlag(0);
|
||||
SET_FLAG_FROM_TEST(flag, from_sock.in_out & SOCK_IN, NODE_INTERFACE_SOCKET_INPUT);
|
||||
SET_FLAG_FROM_TEST(flag, from_sock.in_out & SOCK_OUT, NODE_INTERFACE_SOCKET_OUTPUT);
|
||||
|
||||
bNodeTreeInterfaceSocket *iosock = ntree.tree_interface.add_socket(
|
||||
name, from_sock.description, socket_type, flag, nullptr);
|
||||
if (iosock == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
const bNodeSocketType *typeinfo = iosock->socket_typeinfo();
|
||||
if (typeinfo->interface_from_socket) {
|
||||
typeinfo->interface_from_socket(&ntree.id, iosock, &from_node, &from_sock);
|
||||
UNUSED_VARS(from_sock);
|
||||
}
|
||||
return iosock;
|
||||
}
|
||||
|
||||
static bNodeTreeInterfacePanel *make_panel(const int uid,
|
||||
blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
const blender::StringRef name,
|
||||
const blender::StringRef description,
|
||||
const NodeTreeInterfacePanelFlag flag)
|
||||
{
|
||||
BLI_assert(name.c_str() != nullptr);
|
||||
|
||||
bNodeTreeInterfacePanel *new_panel = MEM_cnew<bNodeTreeInterfacePanel>(__func__);
|
||||
new_panel->item.item_type = NODE_INTERFACE_PANEL;
|
||||
new_panel->name = BLI_strdup(name.c_str());
|
||||
new_panel->description = BLI_strdup_null(description.c_str());
|
||||
new_panel->name = BLI_strdupn(name.data(), name.size());
|
||||
new_panel->description = description.is_empty() ?
|
||||
nullptr :
|
||||
BLI_strdupn(description.data(), description.size());
|
||||
new_panel->identifier = uid;
|
||||
new_panel->flag = flag;
|
||||
return new_panel;
|
||||
}
|
||||
|
||||
} // namespace blender::bke::node_interface
|
||||
|
||||
void bNodeTreeInterface::init_data()
|
||||
{
|
||||
this->runtime = MEM_new<blender::bke::bNodeTreeInterfaceRuntime>(__func__);
|
||||
|
@ -1112,9 +1145,9 @@ void bNodeTreeInterface::active_item_set(bNodeTreeInterfaceItem *item)
|
|||
});
|
||||
}
|
||||
|
||||
bNodeTreeInterfaceSocket *bNodeTreeInterface::add_socket(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
blender::StringRefNull socket_type,
|
||||
bNodeTreeInterfaceSocket *bNodeTreeInterface::add_socket(const blender::StringRef name,
|
||||
const blender::StringRef description,
|
||||
const blender::StringRef socket_type,
|
||||
const NodeTreeInterfaceSocketFlag flag,
|
||||
bNodeTreeInterfacePanel *parent)
|
||||
{
|
||||
|
@ -1133,9 +1166,9 @@ bNodeTreeInterfaceSocket *bNodeTreeInterface::add_socket(blender::StringRefNull
|
|||
return new_socket;
|
||||
}
|
||||
|
||||
bNodeTreeInterfaceSocket *bNodeTreeInterface::insert_socket(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
blender::StringRefNull socket_type,
|
||||
bNodeTreeInterfaceSocket *bNodeTreeInterface::insert_socket(const blender::StringRef name,
|
||||
const blender::StringRef description,
|
||||
const blender::StringRef socket_type,
|
||||
const NodeTreeInterfaceSocketFlag flag,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
const int position)
|
||||
|
@ -1155,8 +1188,8 @@ bNodeTreeInterfaceSocket *bNodeTreeInterface::insert_socket(blender::StringRefNu
|
|||
return new_socket;
|
||||
}
|
||||
|
||||
bNodeTreeInterfacePanel *bNodeTreeInterface::add_panel(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
bNodeTreeInterfacePanel *bNodeTreeInterface::add_panel(const blender::StringRef name,
|
||||
const blender::StringRef description,
|
||||
const NodeTreeInterfacePanelFlag flag,
|
||||
bNodeTreeInterfacePanel *parent)
|
||||
{
|
||||
|
@ -1179,8 +1212,8 @@ bNodeTreeInterfacePanel *bNodeTreeInterface::add_panel(blender::StringRefNull na
|
|||
return new_panel;
|
||||
}
|
||||
|
||||
bNodeTreeInterfacePanel *bNodeTreeInterface::insert_panel(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
bNodeTreeInterfacePanel *bNodeTreeInterface::insert_panel(const blender::StringRef name,
|
||||
const blender::StringRef description,
|
||||
const NodeTreeInterfacePanelFlag flag,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
const int position)
|
||||
|
|
|
@ -100,14 +100,14 @@ class BitSpan {
|
|||
return IndexRange(bit_range_.size());
|
||||
}
|
||||
|
||||
BitRef operator[](const int64_t index) const
|
||||
[[nodiscard]] BitRef operator[](const int64_t index) const
|
||||
{
|
||||
BLI_assert(index >= 0);
|
||||
BLI_assert(index < bit_range_.size());
|
||||
return {data_, bit_range_.start() + index};
|
||||
}
|
||||
|
||||
BitSpan slice(const IndexRange range) const
|
||||
[[nodiscard]] BitSpan slice(const IndexRange range) const
|
||||
{
|
||||
return {data_, bit_range_.slice(range)};
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ class BitVector {
|
|||
/**
|
||||
* Get a read-only reference to a specific bit.
|
||||
*/
|
||||
BitRef operator[](const int64_t index) const
|
||||
[[nodiscard]] BitRef operator[](const int64_t index) const
|
||||
{
|
||||
BLI_assert(index >= 0);
|
||||
BLI_assert(index < size_in_bits_);
|
||||
|
@ -218,7 +218,7 @@ class BitVector {
|
|||
/**
|
||||
* Get a mutable reference to a specific bit.
|
||||
*/
|
||||
MutableBitRef operator[](const int64_t index)
|
||||
[[nodiscard]] MutableBitRef operator[](const int64_t index)
|
||||
{
|
||||
BLI_assert(index >= 0);
|
||||
BLI_assert(index < size_in_bits_);
|
||||
|
|
|
@ -159,7 +159,7 @@ void blo_write_id_struct(BlendWriter *writer, int struct_id, const void *id_addr
|
|||
*/
|
||||
struct BLO_Write_IDBuffer;
|
||||
|
||||
BLO_Write_IDBuffer *BLO_write_allocate_id_buffer(void);
|
||||
BLO_Write_IDBuffer *BLO_write_allocate_id_buffer();
|
||||
void BLO_write_init_id_buffer_from_id(BLO_Write_IDBuffer *id_buffer, ID *id, const bool is_undo);
|
||||
ID *BLO_write_get_id_buffer_temp_id(BLO_Write_IDBuffer *id_buffer);
|
||||
void BLO_write_destroy_id_buffer(BLO_Write_IDBuffer **id_buffer);
|
||||
|
|
|
@ -33,19 +33,18 @@
|
|||
#include "DNA_ID.h"
|
||||
|
||||
/* Dependency Graph */
|
||||
typedef struct Depsgraph Depsgraph;
|
||||
struct Depsgraph;
|
||||
|
||||
/* ------------------------------------------------ */
|
||||
|
||||
struct Main;
|
||||
|
||||
struct Scene;
|
||||
struct ViewLayer;
|
||||
|
||||
typedef enum eEvaluationMode {
|
||||
enum eEvaluationMode {
|
||||
DAG_EVAL_VIEWPORT = 0, /* evaluate for OpenGL viewport */
|
||||
DAG_EVAL_RENDER = 1, /* evaluate for render purposes */
|
||||
} eEvaluationMode;
|
||||
};
|
||||
|
||||
/* DagNode->eval_flags */
|
||||
enum {
|
||||
|
@ -72,10 +71,7 @@ enum {
|
|||
*
|
||||
* TODO: what arguments are needed here? What's the building-graph entry point?
|
||||
*/
|
||||
Depsgraph *DEG_graph_new(struct Main *bmain,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer,
|
||||
eEvaluationMode mode);
|
||||
Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode);
|
||||
|
||||
/**
|
||||
* Replace the "owner" pointers (currently Main/Scene/ViewLayer) of this depsgraph.
|
||||
|
@ -83,10 +79,10 @@ Depsgraph *DEG_graph_new(struct Main *bmain,
|
|||
* - Undo steps when we do want to re-use the old depsgraph data as much as possible.
|
||||
* - Rendering where we want to re-use objects between different view layers.
|
||||
*/
|
||||
void DEG_graph_replace_owners(struct Depsgraph *depsgraph,
|
||||
struct Main *bmain,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer);
|
||||
void DEG_graph_replace_owners(Depsgraph *depsgraph,
|
||||
Main *bmain,
|
||||
Scene *scene,
|
||||
ViewLayer *view_layer);
|
||||
|
||||
/** Free graph's contents and graph itself. */
|
||||
void DEG_graph_free(Depsgraph *graph);
|
||||
|
@ -98,10 +94,10 @@ void DEG_graph_free(Depsgraph *graph);
|
|||
* \{ */
|
||||
|
||||
/** Register all node types. */
|
||||
void DEG_register_node_types(void);
|
||||
void DEG_register_node_types();
|
||||
|
||||
/** Free node type registry on exit. */
|
||||
void DEG_free_node_types(void);
|
||||
void DEG_free_node_types();
|
||||
|
||||
/** \} */
|
||||
|
||||
|
@ -113,7 +109,7 @@ void DEG_free_node_types(void);
|
|||
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time);
|
||||
|
||||
/** Tag all dependency graphs for update when visible scenes/layers changes. */
|
||||
void DEG_tag_on_visible_update(struct Main *bmain, bool do_time);
|
||||
void DEG_tag_on_visible_update(Main *bmain, bool do_time);
|
||||
|
||||
/**
|
||||
* \note Will return NULL if the flag is not known, allowing to gracefully handle situations
|
||||
|
@ -122,36 +118,33 @@ void DEG_tag_on_visible_update(struct Main *bmain, bool do_time);
|
|||
const char *DEG_update_tag_as_string(IDRecalcFlag flag);
|
||||
|
||||
/** Tag given ID for an update in all the dependency graphs. */
|
||||
void DEG_id_tag_update(struct ID *id, unsigned int flags);
|
||||
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, unsigned int flags);
|
||||
void DEG_id_tag_update(ID *id, unsigned int flags);
|
||||
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags);
|
||||
|
||||
void DEG_graph_id_tag_update(struct Main *bmain,
|
||||
struct Depsgraph *depsgraph,
|
||||
struct ID *id,
|
||||
unsigned int flags);
|
||||
void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, unsigned int flags);
|
||||
|
||||
/** Tag all dependency graphs when time has changed. */
|
||||
void DEG_time_tag_update(struct Main *bmain);
|
||||
void DEG_time_tag_update(Main *bmain);
|
||||
|
||||
/** Tag a dependency graph when time has changed. */
|
||||
void DEG_graph_time_tag_update(struct Depsgraph *depsgraph);
|
||||
void DEG_graph_time_tag_update(Depsgraph *depsgraph);
|
||||
|
||||
/**
|
||||
* Mark a particular data-block type as having changing.
|
||||
* This does not cause any updates but is used by external
|
||||
* render engines to detect if for example a data-block was removed.
|
||||
*/
|
||||
void DEG_graph_id_type_tag(struct Depsgraph *depsgraph, short id_type);
|
||||
void DEG_id_type_tag(struct Main *bmain, short id_type);
|
||||
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type);
|
||||
void DEG_id_type_tag(Main *bmain, short id_type);
|
||||
|
||||
/**
|
||||
* Set a depsgraph to flush updates to editors. This would be done
|
||||
* for viewport depsgraphs, but not render or export depsgraph for example.
|
||||
*/
|
||||
void DEG_enable_editors_update(struct Depsgraph *depsgraph);
|
||||
void DEG_enable_editors_update(Depsgraph *depsgraph);
|
||||
|
||||
/** Check if something was changed in the database and inform editors about this. */
|
||||
void DEG_editors_update(struct Depsgraph *depsgraph, bool time);
|
||||
void DEG_editors_update(Depsgraph *depsgraph, bool time);
|
||||
|
||||
/** Clear recalc flags after editors or renderers have handled updates. */
|
||||
void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup);
|
||||
|
@ -193,15 +186,15 @@ void DEG_evaluate_on_refresh(Depsgraph *graph);
|
|||
* to do their own updates based on changes.
|
||||
* \{ */
|
||||
|
||||
typedef struct DEGEditorUpdateContext {
|
||||
struct Main *bmain;
|
||||
struct Depsgraph *depsgraph;
|
||||
struct Scene *scene;
|
||||
struct ViewLayer *view_layer;
|
||||
} DEGEditorUpdateContext;
|
||||
struct DEGEditorUpdateContext {
|
||||
Main *bmain;
|
||||
Depsgraph *depsgraph;
|
||||
Scene *scene;
|
||||
ViewLayer *view_layer;
|
||||
};
|
||||
|
||||
typedef void (*DEG_EditorUpdateIDCb)(const DEGEditorUpdateContext *update_ctx, struct ID *id);
|
||||
typedef void (*DEG_EditorUpdateSceneCb)(const DEGEditorUpdateContext *update_ctx, bool updated);
|
||||
using DEG_EditorUpdateIDCb = void (*)(const DEGEditorUpdateContext *update_ctx, ID *id);
|
||||
using DEG_EditorUpdateSceneCb = void (*)(const DEGEditorUpdateContext *update_ctx, bool updated);
|
||||
|
||||
/** Set callbacks which are being called when depsgraph changes. */
|
||||
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func);
|
||||
|
@ -212,11 +205,11 @@ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSce
|
|||
/** \name Evaluation
|
||||
* \{ */
|
||||
|
||||
bool DEG_is_evaluating(const struct Depsgraph *depsgraph);
|
||||
bool DEG_is_evaluating(const Depsgraph *depsgraph);
|
||||
|
||||
bool DEG_is_active(const struct Depsgraph *depsgraph);
|
||||
void DEG_make_active(struct Depsgraph *depsgraph);
|
||||
void DEG_make_inactive(struct Depsgraph *depsgraph);
|
||||
bool DEG_is_active(const Depsgraph *depsgraph);
|
||||
void DEG_make_active(Depsgraph *depsgraph);
|
||||
void DEG_make_inactive(Depsgraph *depsgraph);
|
||||
|
||||
/**
|
||||
* Disable the visibility optimization making it so IDs which affect hidden objects or disabled
|
||||
|
@ -224,7 +217,7 @@ void DEG_make_inactive(struct Depsgraph *depsgraph);
|
|||
*
|
||||
* For example, this ensures that an object which is needed by a modifier is ignoring checks about
|
||||
* whether the object is hidden or the modifier is disabled. */
|
||||
void DEG_disable_visibility_optimization(struct Depsgraph *depsgraph);
|
||||
void DEG_disable_visibility_optimization(Depsgraph *depsgraph);
|
||||
|
||||
/** \} */
|
||||
|
||||
|
@ -232,14 +225,14 @@ void DEG_disable_visibility_optimization(struct Depsgraph *depsgraph);
|
|||
/** \name Evaluation Debug
|
||||
* \{ */
|
||||
|
||||
void DEG_debug_print_begin(struct Depsgraph *depsgraph);
|
||||
void DEG_debug_print_begin(Depsgraph *depsgraph);
|
||||
|
||||
void DEG_debug_print_eval(struct Depsgraph *depsgraph,
|
||||
void DEG_debug_print_eval(Depsgraph *depsgraph,
|
||||
const char *function_name,
|
||||
const char *object_name,
|
||||
const void *object_address);
|
||||
|
||||
void DEG_debug_print_eval_subdata(struct Depsgraph *depsgraph,
|
||||
void DEG_debug_print_eval_subdata(Depsgraph *depsgraph,
|
||||
const char *function_name,
|
||||
const char *object_name,
|
||||
const void *object_address,
|
||||
|
@ -247,7 +240,7 @@ void DEG_debug_print_eval_subdata(struct Depsgraph *depsgraph,
|
|||
const char *subdata_name,
|
||||
const void *subdata_address);
|
||||
|
||||
void DEG_debug_print_eval_subdata_index(struct Depsgraph *depsgraph,
|
||||
void DEG_debug_print_eval_subdata_index(Depsgraph *depsgraph,
|
||||
const char *function_name,
|
||||
const char *object_name,
|
||||
const void *object_address,
|
||||
|
@ -256,7 +249,7 @@ void DEG_debug_print_eval_subdata_index(struct Depsgraph *depsgraph,
|
|||
const void *subdata_address,
|
||||
int subdata_index);
|
||||
|
||||
void DEG_debug_print_eval_parent_typed(struct Depsgraph *depsgraph,
|
||||
void DEG_debug_print_eval_parent_typed(Depsgraph *depsgraph,
|
||||
const char *function_name,
|
||||
const char *object_name,
|
||||
const void *object_address,
|
||||
|
@ -264,7 +257,7 @@ void DEG_debug_print_eval_parent_typed(struct Depsgraph *depsgraph,
|
|||
const char *parent_name,
|
||||
const void *parent_address);
|
||||
|
||||
void DEG_debug_print_eval_time(struct Depsgraph *depsgraph,
|
||||
void DEG_debug_print_eval_time(Depsgraph *depsgraph,
|
||||
const char *function_name,
|
||||
const char *object_name,
|
||||
const void *object_address,
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
/* ************************************************* */
|
||||
|
||||
/* Dependency Graph */
|
||||
|
@ -26,23 +28,21 @@ struct Object;
|
|||
struct Scene;
|
||||
struct bNodeTree;
|
||||
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
/* Graph Building -------------------------------- */
|
||||
|
||||
/** Build depsgraph for the given scene layer, and dump results in given graph container. */
|
||||
void DEG_graph_build_from_view_layer(struct Depsgraph *graph);
|
||||
void DEG_graph_build_from_view_layer(Depsgraph *graph);
|
||||
|
||||
/**
|
||||
* Build depsgraph for all objects (so also invisible ones) in the given view layer.
|
||||
*/
|
||||
void DEG_graph_build_for_all_objects(struct Depsgraph *graph);
|
||||
void DEG_graph_build_for_all_objects(Depsgraph *graph);
|
||||
|
||||
/**
|
||||
* Special version of builder which produces dependency graph suitable for the render pipeline.
|
||||
* It will contain sequencer and compositor (if needed) and all their dependencies.
|
||||
*/
|
||||
void DEG_graph_build_for_render_pipeline(struct Depsgraph *graph);
|
||||
void DEG_graph_build_for_render_pipeline(Depsgraph *graph);
|
||||
|
||||
/**
|
||||
* Builds minimal dependency graph for compositor preview.
|
||||
|
@ -50,21 +50,21 @@ void DEG_graph_build_for_render_pipeline(struct Depsgraph *graph);
|
|||
* Note that compositor editor might have pinned node tree, which is different from scene's node
|
||||
* tree.
|
||||
*/
|
||||
void DEG_graph_build_for_compositor_preview(struct Depsgraph *graph, struct bNodeTree *nodetree);
|
||||
void DEG_graph_build_for_compositor_preview(Depsgraph *graph, bNodeTree *nodetree);
|
||||
|
||||
/**
|
||||
* Builds the minimal dependency graph needed for evaluation of the given IDs.
|
||||
*/
|
||||
void DEG_graph_build_from_ids(struct Depsgraph *graph, struct ID **ids, int num_ids);
|
||||
void DEG_graph_build_from_ids(Depsgraph *graph, ID **ids, int num_ids);
|
||||
|
||||
/** Tag relations from the given graph for update. */
|
||||
void DEG_graph_tag_relations_update(struct Depsgraph *graph);
|
||||
void DEG_graph_tag_relations_update(Depsgraph *graph);
|
||||
|
||||
/** Create or update relations in the specified graph. */
|
||||
void DEG_graph_relations_update(struct Depsgraph *graph);
|
||||
void DEG_graph_relations_update(Depsgraph *graph);
|
||||
|
||||
/** Tag all relations in the database for update. */
|
||||
void DEG_relations_tag_update(struct Main *bmain);
|
||||
void DEG_relations_tag_update(Main *bmain);
|
||||
|
||||
/* Add Dependencies ----------------------------- */
|
||||
|
||||
|
@ -116,39 +116,37 @@ typedef enum eDepsObjectComponentType {
|
|||
DEG_OB_COMP_CACHE,
|
||||
} eDepsObjectComponentType;
|
||||
|
||||
void DEG_add_scene_relation(struct DepsNodeHandle *node_handle,
|
||||
struct Scene *scene,
|
||||
void DEG_add_scene_relation(DepsNodeHandle *node_handle,
|
||||
Scene *scene,
|
||||
eDepsSceneComponentType component,
|
||||
const char *description);
|
||||
void DEG_add_object_relation(struct DepsNodeHandle *node_handle,
|
||||
struct Object *object,
|
||||
void DEG_add_object_relation(DepsNodeHandle *node_handle,
|
||||
Object *object,
|
||||
eDepsObjectComponentType component,
|
||||
const char *description);
|
||||
void DEG_add_collection_geometry_relation(struct DepsNodeHandle *node_handle,
|
||||
struct Collection *collection,
|
||||
void DEG_add_collection_geometry_relation(DepsNodeHandle *node_handle,
|
||||
Collection *collection,
|
||||
const char *description);
|
||||
void DEG_add_collection_geometry_customdata_mask(struct DepsNodeHandle *node_handle,
|
||||
struct Collection *collection,
|
||||
const struct CustomData_MeshMasks *masks);
|
||||
void DEG_add_node_tree_output_relation(struct DepsNodeHandle *node_handle,
|
||||
struct bNodeTree *node_tree,
|
||||
void DEG_add_collection_geometry_customdata_mask(DepsNodeHandle *node_handle,
|
||||
Collection *collection,
|
||||
const CustomData_MeshMasks *masks);
|
||||
void DEG_add_node_tree_output_relation(DepsNodeHandle *node_handle,
|
||||
bNodeTree *node_tree,
|
||||
const char *description);
|
||||
void DEG_add_bone_relation(struct DepsNodeHandle *handle,
|
||||
struct Object *object,
|
||||
void DEG_add_bone_relation(DepsNodeHandle *handle,
|
||||
Object *object,
|
||||
const char *bone_name,
|
||||
eDepsObjectComponentType component,
|
||||
const char *description);
|
||||
void DEG_add_object_cache_relation(struct DepsNodeHandle *handle,
|
||||
struct CacheFile *cache_file,
|
||||
void DEG_add_object_cache_relation(DepsNodeHandle *handle,
|
||||
CacheFile *cache_file,
|
||||
eDepsObjectComponentType component,
|
||||
const char *description);
|
||||
/**
|
||||
* Adds relation from #DEG_OPCODE_GENERIC_DATABLOCK_UPDATE of a given ID.
|
||||
* Is used for such entities as textures and images.
|
||||
*/
|
||||
void DEG_add_generic_id_relation(struct DepsNodeHandle *node_handle,
|
||||
struct ID *id,
|
||||
const char *description);
|
||||
void DEG_add_generic_id_relation(DepsNodeHandle *node_handle, ID *id, const char *description);
|
||||
|
||||
/**
|
||||
* Special function which is used from modifiers' #update_depsgraph() callback
|
||||
|
@ -157,26 +155,25 @@ void DEG_add_generic_id_relation(struct DepsNodeHandle *node_handle,
|
|||
* This function will take care of checking which operation is required to
|
||||
* have transformation for the modifier, taking into account possible simulation solvers.
|
||||
*/
|
||||
void DEG_add_depends_on_transform_relation(struct DepsNodeHandle *node_handle,
|
||||
const char *description);
|
||||
void DEG_add_depends_on_transform_relation(DepsNodeHandle *node_handle, const char *description);
|
||||
|
||||
/**
|
||||
* Adds relations from the given component of a given object to the given node
|
||||
* handle AND the component to the point cache component of the node's ID.
|
||||
*/
|
||||
void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle,
|
||||
struct Object *object,
|
||||
void DEG_add_object_pointcache_relation(DepsNodeHandle *node_handle,
|
||||
Object *object,
|
||||
eDepsObjectComponentType component,
|
||||
const char *description);
|
||||
|
||||
void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, struct ID *id, uint32_t flag);
|
||||
void DEG_add_customdata_mask(struct DepsNodeHandle *handle,
|
||||
struct Object *object,
|
||||
const struct CustomData_MeshMasks *masks);
|
||||
void DEG_add_special_eval_flag(DepsNodeHandle *handle, ID *id, uint32_t flag);
|
||||
void DEG_add_customdata_mask(DepsNodeHandle *handle,
|
||||
Object *object,
|
||||
const CustomData_MeshMasks *masks);
|
||||
|
||||
struct ID *DEG_get_id_from_handle(struct DepsNodeHandle *node_handle);
|
||||
struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle);
|
||||
ID *DEG_get_id_from_handle(DepsNodeHandle *node_handle);
|
||||
Depsgraph *DEG_get_graph_from_handle(DepsNodeHandle *node_handle);
|
||||
|
||||
bool DEG_object_has_geometry_component(struct Object *object);
|
||||
bool DEG_object_has_geometry_component(Object *object);
|
||||
|
||||
/* ************************************************ */
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
struct Depsgraph;
|
||||
struct Main;
|
||||
struct Scene;
|
||||
struct ViewLayer;
|
||||
|
||||
|
@ -20,11 +21,11 @@ struct ViewLayer;
|
|||
|
||||
/* NOTE: Those flags are same bit-mask as #G.debug_flags */
|
||||
|
||||
void DEG_debug_flags_set(struct Depsgraph *depsgraph, int flags);
|
||||
int DEG_debug_flags_get(const struct Depsgraph *depsgraph);
|
||||
void DEG_debug_flags_set(Depsgraph *depsgraph, int flags);
|
||||
int DEG_debug_flags_get(const Depsgraph *depsgraph);
|
||||
|
||||
void DEG_debug_name_set(struct Depsgraph *depsgraph, const char *name);
|
||||
const char *DEG_debug_name_get(struct Depsgraph *depsgraph);
|
||||
void DEG_debug_name_set(Depsgraph *depsgraph, const char *name);
|
||||
const char *DEG_debug_name_get(Depsgraph *depsgraph);
|
||||
|
||||
/* ------------------------------------------------ */
|
||||
|
||||
|
@ -34,7 +35,7 @@ const char *DEG_debug_name_get(struct Depsgraph *depsgraph);
|
|||
* \param[out] r_operations: The number of operation nodes in the graph.
|
||||
* \param[out] r_relations: The number of relations between (executable) nodes in the graph.
|
||||
*/
|
||||
void DEG_stats_simple(const struct Depsgraph *graph,
|
||||
void DEG_stats_simple(const Depsgraph *graph,
|
||||
size_t *r_outer,
|
||||
size_t *r_operations,
|
||||
size_t *r_relations);
|
||||
|
@ -42,9 +43,9 @@ void DEG_stats_simple(const struct Depsgraph *graph,
|
|||
/* ************************************************ */
|
||||
/* Diagram-Based Graph Debugging */
|
||||
|
||||
void DEG_debug_relations_graphviz(const struct Depsgraph *graph, FILE *fp, const char *label);
|
||||
void DEG_debug_relations_graphviz(const Depsgraph *graph, FILE *fp, const char *label);
|
||||
|
||||
void DEG_debug_stats_gnuplot(const struct Depsgraph *graph,
|
||||
void DEG_debug_stats_gnuplot(const Depsgraph *graph,
|
||||
FILE *fp,
|
||||
const char *label,
|
||||
const char *output_filename);
|
||||
|
@ -52,13 +53,13 @@ void DEG_debug_stats_gnuplot(const struct Depsgraph *graph,
|
|||
/* ************************************************ */
|
||||
|
||||
/** Compare two dependency graphs. */
|
||||
bool DEG_debug_compare(const struct Depsgraph *graph1, const struct Depsgraph *graph2);
|
||||
bool DEG_debug_compare(const Depsgraph *graph1, const Depsgraph *graph2);
|
||||
|
||||
/** Check that dependencies in the graph are really up to date. */
|
||||
bool DEG_debug_graph_relations_validate(struct Depsgraph *graph,
|
||||
struct Main *bmain,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer);
|
||||
bool DEG_debug_graph_relations_validate(Depsgraph *graph,
|
||||
Main *bmain,
|
||||
Scene *scene,
|
||||
ViewLayer *view_layer);
|
||||
|
||||
/** Perform consistency check on the graph. */
|
||||
bool DEG_debug_consistency_check(struct Depsgraph *graph);
|
||||
bool DEG_debug_consistency_check(Depsgraph *graph);
|
||||
|
|
|
@ -12,41 +12,42 @@
|
|||
|
||||
#include "DEG_depsgraph.hh"
|
||||
|
||||
struct Collection;
|
||||
struct DepsNodeHandle;
|
||||
struct Depsgraph;
|
||||
struct EffectorWeights;
|
||||
struct ListBase;
|
||||
struct ModifierData;
|
||||
struct Object;
|
||||
|
||||
typedef enum ePhysicsRelationType {
|
||||
enum ePhysicsRelationType {
|
||||
DEG_PHYSICS_EFFECTOR = 0,
|
||||
DEG_PHYSICS_COLLISION = 1,
|
||||
DEG_PHYSICS_SMOKE_COLLISION = 2,
|
||||
DEG_PHYSICS_DYNAMIC_BRUSH = 3,
|
||||
DEG_PHYSICS_RELATIONS_NUM = 4,
|
||||
} ePhysicsRelationType;
|
||||
};
|
||||
|
||||
/* Get collision/effector relations from collection or entire scene. These
|
||||
* created during depsgraph relations building and should only be accessed
|
||||
* during evaluation. */
|
||||
struct ListBase *DEG_get_effector_relations(const struct Depsgraph *depsgraph,
|
||||
struct Collection *collection);
|
||||
struct ListBase *DEG_get_collision_relations(const struct Depsgraph *depsgraph,
|
||||
struct Collection *collection,
|
||||
unsigned int modifier_type);
|
||||
ListBase *DEG_get_effector_relations(const Depsgraph *depsgraph, Collection *collection);
|
||||
ListBase *DEG_get_collision_relations(const Depsgraph *depsgraph,
|
||||
Collection *collection,
|
||||
unsigned int modifier_type);
|
||||
|
||||
/* Build collision/effector relations for depsgraph. */
|
||||
typedef bool (*DEG_CollobjFilterFunction)(struct Object *obj, struct ModifierData *md);
|
||||
using DEG_CollobjFilterFunction = bool (*)(Object *obj, ModifierData *md);
|
||||
|
||||
void DEG_add_collision_relations(struct DepsNodeHandle *handle,
|
||||
struct Object *object,
|
||||
struct Collection *collection,
|
||||
void DEG_add_collision_relations(DepsNodeHandle *handle,
|
||||
Object *object,
|
||||
Collection *collection,
|
||||
unsigned int modifier_type,
|
||||
DEG_CollobjFilterFunction filter_function,
|
||||
const char *name);
|
||||
void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
|
||||
struct Object *object,
|
||||
struct EffectorWeights *eff,
|
||||
void DEG_add_forcefield_relations(DepsNodeHandle *handle,
|
||||
Object *object,
|
||||
EffectorWeights *eff,
|
||||
bool add_absorption,
|
||||
int skip_forcefield,
|
||||
const char *name);
|
||||
|
|
|
@ -35,13 +35,13 @@ struct ViewerPath;
|
|||
* \{ */
|
||||
|
||||
/** Get scene that depsgraph was built for. */
|
||||
struct Scene *DEG_get_input_scene(const Depsgraph *graph);
|
||||
Scene *DEG_get_input_scene(const Depsgraph *graph);
|
||||
|
||||
/** Get view layer that depsgraph was built for. */
|
||||
struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph);
|
||||
ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph);
|
||||
|
||||
/** Get bmain that depsgraph was built for. */
|
||||
struct Main *DEG_get_bmain(const Depsgraph *graph);
|
||||
Main *DEG_get_bmain(const Depsgraph *graph);
|
||||
|
||||
/** Get evaluation mode that depsgraph was built for. */
|
||||
eEvaluationMode DEG_get_mode(const Depsgraph *graph);
|
||||
|
@ -56,19 +56,19 @@ float DEG_get_ctime(const Depsgraph *graph);
|
|||
* \{ */
|
||||
|
||||
/** Check if given ID type was tagged for update. */
|
||||
bool DEG_id_type_updated(const struct Depsgraph *depsgraph, short id_type);
|
||||
bool DEG_id_type_any_updated(const struct Depsgraph *depsgraph);
|
||||
bool DEG_id_type_updated(const Depsgraph *depsgraph, short id_type);
|
||||
bool DEG_id_type_any_updated(const Depsgraph *depsgraph);
|
||||
|
||||
/** Check if given ID type is present in the depsgraph */
|
||||
bool DEG_id_type_any_exists(const struct Depsgraph *depsgraph, short id_type);
|
||||
bool DEG_id_type_any_exists(const Depsgraph *depsgraph, short id_type);
|
||||
|
||||
/** Get additional evaluation flags for the given ID. */
|
||||
uint32_t DEG_get_eval_flags_for_id(const struct Depsgraph *graph, const struct ID *id);
|
||||
uint32_t DEG_get_eval_flags_for_id(const Depsgraph *graph, const ID *id);
|
||||
|
||||
/** Get additional mesh CustomData_MeshMasks flags for the given object. */
|
||||
void DEG_get_customdata_mask_for_object(const struct Depsgraph *graph,
|
||||
struct Object *object,
|
||||
struct CustomData_MeshMasks *r_mask);
|
||||
void DEG_get_customdata_mask_for_object(const Depsgraph *graph,
|
||||
Object *object,
|
||||
CustomData_MeshMasks *r_mask);
|
||||
|
||||
/**
|
||||
* Get scene at its evaluated state.
|
||||
|
@ -77,30 +77,30 @@ void DEG_get_customdata_mask_for_object(const struct Depsgraph *graph,
|
|||
* This function will check that the data-block has been expanded (and copied) from the original
|
||||
* one. Assert will happen if it's not.
|
||||
*/
|
||||
struct Scene *DEG_get_evaluated_scene(const struct Depsgraph *graph);
|
||||
Scene *DEG_get_evaluated_scene(const Depsgraph *graph);
|
||||
|
||||
/**
|
||||
* Get view layer at its evaluated state.
|
||||
* This is a shortcut for accessing active view layer from evaluated scene.
|
||||
*/
|
||||
struct ViewLayer *DEG_get_evaluated_view_layer(const struct Depsgraph *graph);
|
||||
ViewLayer *DEG_get_evaluated_view_layer(const Depsgraph *graph);
|
||||
|
||||
/** Get evaluated version of object for given original one. */
|
||||
struct Object *DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object);
|
||||
Object *DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object);
|
||||
|
||||
/** Get evaluated version of given ID data-block. */
|
||||
struct ID *DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id);
|
||||
ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id);
|
||||
|
||||
/** Get evaluated version of data pointed to by RNA pointer */
|
||||
void DEG_get_evaluated_rna_pointer(const struct Depsgraph *depsgraph,
|
||||
struct PointerRNA *ptr,
|
||||
struct PointerRNA *r_ptr_eval);
|
||||
void DEG_get_evaluated_rna_pointer(const Depsgraph *depsgraph,
|
||||
PointerRNA *ptr,
|
||||
PointerRNA *r_ptr_eval);
|
||||
|
||||
/** Get original version of object for given evaluated one. */
|
||||
struct Object *DEG_get_original_object(struct Object *object);
|
||||
Object *DEG_get_original_object(Object *object);
|
||||
|
||||
/** Get original version of given evaluated ID data-block. */
|
||||
struct ID *DEG_get_original_id(struct ID *id);
|
||||
ID *DEG_get_original_id(ID *id);
|
||||
|
||||
/**
|
||||
* Check whether given ID is an original.
|
||||
|
@ -108,22 +108,22 @@ struct ID *DEG_get_original_id(struct ID *id);
|
|||
* Original IDs are considered all the IDs which are not covered by copy-on-write system and are
|
||||
* not out-of-main localized data-blocks.
|
||||
*/
|
||||
bool DEG_is_original_id(const struct ID *id);
|
||||
bool DEG_is_original_object(const struct Object *object);
|
||||
bool DEG_is_original_id(const ID *id);
|
||||
bool DEG_is_original_object(const Object *object);
|
||||
|
||||
/* Opposite of the above.
|
||||
*
|
||||
* If the data-block is not original it must be evaluated, and vice versa. */
|
||||
|
||||
bool DEG_is_evaluated_id(const struct ID *id);
|
||||
bool DEG_is_evaluated_object(const struct Object *object);
|
||||
bool DEG_is_evaluated_id(const ID *id);
|
||||
bool DEG_is_evaluated_object(const Object *object);
|
||||
|
||||
/**
|
||||
* Check whether depsgraph is fully evaluated. This includes the following checks:
|
||||
* - Relations are up-to-date.
|
||||
* - Nothing is tagged for update.
|
||||
*/
|
||||
bool DEG_is_fully_evaluated(const struct Depsgraph *depsgraph);
|
||||
bool DEG_is_fully_evaluated(const Depsgraph *depsgraph);
|
||||
|
||||
/** \} */
|
||||
|
||||
|
@ -140,8 +140,8 @@ typedef enum DegIterFlag {
|
|||
} DegIterFlag;
|
||||
ENUM_OPERATORS(DegIterFlag, DEG_ITER_OBJECT_FLAG_DUPLI)
|
||||
|
||||
typedef struct DEGObjectIterSettings {
|
||||
struct Depsgraph *depsgraph;
|
||||
struct DEGObjectIterSettings {
|
||||
Depsgraph *depsgraph;
|
||||
/**
|
||||
* Bit-field of the #DegIterFlag.
|
||||
*
|
||||
|
@ -155,8 +155,8 @@ typedef struct DEGObjectIterSettings {
|
|||
* When set, the final evaluated geometry of the corresponding object is omitted. Instead the
|
||||
* geometry for the viewer path included in the iterator.
|
||||
*/
|
||||
const struct ViewerPath *viewer_path;
|
||||
} DEGObjectIterSettings;
|
||||
const ViewerPath *viewer_path;
|
||||
};
|
||||
|
||||
/**
|
||||
* Flags to get objects for draw manager and final render.
|
||||
|
@ -165,43 +165,43 @@ typedef struct DEGObjectIterSettings {
|
|||
DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | \
|
||||
DEG_ITER_OBJECT_FLAG_VISIBLE | DEG_ITER_OBJECT_FLAG_DUPLI
|
||||
|
||||
typedef struct DEGObjectIterData {
|
||||
struct DEGObjectIterData {
|
||||
DEGObjectIterSettings *settings;
|
||||
struct Depsgraph *graph;
|
||||
Depsgraph *graph;
|
||||
int flag;
|
||||
|
||||
struct Scene *scene;
|
||||
Scene *scene;
|
||||
|
||||
eEvaluationMode eval_mode;
|
||||
|
||||
/** Object whose preview instead of evaluated geometry should be part of the iterator. */
|
||||
struct Object *object_orig_with_preview;
|
||||
Object *object_orig_with_preview;
|
||||
|
||||
struct Object *next_object;
|
||||
Object *next_object;
|
||||
|
||||
/* **** Iteration over dupli-list. *** */
|
||||
|
||||
/* Object which created the dupli-list. */
|
||||
struct Object *dupli_parent;
|
||||
Object *dupli_parent;
|
||||
/* List of duplicated objects. */
|
||||
struct ListBase *dupli_list;
|
||||
ListBase *dupli_list;
|
||||
/* Next duplicated object to step into. */
|
||||
struct DupliObject *dupli_object_next;
|
||||
DupliObject *dupli_object_next;
|
||||
/* Corresponds to current object: current iterator object is evaluated from
|
||||
* this duplicated object. */
|
||||
struct DupliObject *dupli_object_current;
|
||||
DupliObject *dupli_object_current;
|
||||
/* Temporary storage to report fully populated DNA to the render engine or
|
||||
* other users of the iterator. */
|
||||
struct Object temp_dupli_object;
|
||||
Object temp_dupli_object;
|
||||
|
||||
/* **** Iteration over ID nodes **** */
|
||||
size_t id_node_index;
|
||||
size_t num_id_nodes;
|
||||
} DEGObjectIterData;
|
||||
};
|
||||
|
||||
void DEG_iterator_objects_begin(struct BLI_Iterator *iter, DEGObjectIterData *data);
|
||||
void DEG_iterator_objects_next(struct BLI_Iterator *iter);
|
||||
void DEG_iterator_objects_end(struct BLI_Iterator *iter);
|
||||
void DEG_iterator_objects_begin(BLI_Iterator *iter, DEGObjectIterData *data);
|
||||
void DEG_iterator_objects_next(BLI_Iterator *iter);
|
||||
void DEG_iterator_objects_end(BLI_Iterator *iter);
|
||||
|
||||
#define DEG_OBJECT_ITER_BEGIN(settings_, instance_) \
|
||||
{ \
|
||||
|
@ -229,17 +229,17 @@ void DEG_iterator_objects_end(struct BLI_Iterator *iter);
|
|||
/** \name DEG ID iterators
|
||||
* \{ */
|
||||
|
||||
typedef struct DEGIDIterData {
|
||||
struct Depsgraph *graph;
|
||||
struct DEGIDIterData {
|
||||
Depsgraph *graph;
|
||||
bool only_updated;
|
||||
|
||||
size_t id_node_index;
|
||||
size_t num_id_nodes;
|
||||
} DEGIDIterData;
|
||||
};
|
||||
|
||||
void DEG_iterator_ids_begin(struct BLI_Iterator *iter, DEGIDIterData *data);
|
||||
void DEG_iterator_ids_next(struct BLI_Iterator *iter);
|
||||
void DEG_iterator_ids_end(struct BLI_Iterator *iter);
|
||||
void DEG_iterator_ids_begin(BLI_Iterator *iter, DEGIDIterData *data);
|
||||
void DEG_iterator_ids_next(BLI_Iterator *iter);
|
||||
void DEG_iterator_ids_end(BLI_Iterator *iter);
|
||||
|
||||
/** \} */
|
||||
|
||||
|
@ -247,10 +247,10 @@ void DEG_iterator_ids_end(struct BLI_Iterator *iter);
|
|||
/** \name DEG traversal
|
||||
* \{ */
|
||||
|
||||
typedef void (*DEGForeachIDCallback)(ID *id, void *user_data);
|
||||
typedef void (*DEGForeachIDComponentCallback)(ID *id,
|
||||
eDepsObjectComponentType component,
|
||||
void *user_data);
|
||||
using DEGForeachIDCallback = void (*)(ID *id, void *user_data);
|
||||
using DEGForeachIDComponentCallback = void (*)(ID *id,
|
||||
eDepsObjectComponentType component,
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
* \note Modifies runtime flags in depsgraph nodes,
|
||||
|
|
|
@ -13,7 +13,7 @@ struct ID;
|
|||
|
||||
namespace blender::deg {
|
||||
|
||||
void deg_editors_id_update(const DEGEditorUpdateContext *update_ctx, struct ID *id);
|
||||
void deg_editors_id_update(const DEGEditorUpdateContext *update_ctx, ID *id);
|
||||
|
||||
void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx, bool updated);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ struct ComponentNode;
|
|||
|
||||
/* Evaluation Operation for atomic operation */
|
||||
/* XXX: move this to another header that can be exposed? */
|
||||
typedef function<void(struct ::Depsgraph *)> DepsEvalOperationCb;
|
||||
typedef function<void(::Depsgraph *)> DepsEvalOperationCb;
|
||||
|
||||
/* Identifiers for common operations (as an enum). */
|
||||
enum class OperationCode {
|
||||
|
|
|
@ -676,7 +676,7 @@ static float *sculpt_expand_boundary_topology_falloff_create(Object *ob, const P
|
|||
continue;
|
||||
}
|
||||
dists[ni.index] = dists[v_next_i] + 1.0f;
|
||||
visited_verts[ni.index];
|
||||
visited_verts[ni.index].set();
|
||||
BLI_gsqueue_push(queue, &ni.vertex);
|
||||
}
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
|
||||
|
|
|
@ -303,9 +303,9 @@ typedef struct bNodeTreeInterface {
|
|||
* \param parent: Panel in which to add the socket. If parent is null the socket is added in the
|
||||
* root panel.
|
||||
*/
|
||||
bNodeTreeInterfaceSocket *add_socket(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
blender::StringRefNull socket_type,
|
||||
bNodeTreeInterfaceSocket *add_socket(blender::StringRef name,
|
||||
blender::StringRef description,
|
||||
blender::StringRef socket_type,
|
||||
NodeTreeInterfaceSocketFlag flag,
|
||||
bNodeTreeInterfacePanel *parent);
|
||||
/**
|
||||
|
@ -314,9 +314,9 @@ typedef struct bNodeTreeInterface {
|
|||
* root panel.
|
||||
* \param position: Position of the socket within the parent panel.
|
||||
*/
|
||||
bNodeTreeInterfaceSocket *insert_socket(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
blender::StringRefNull socket_type,
|
||||
bNodeTreeInterfaceSocket *insert_socket(blender::StringRef name,
|
||||
blender::StringRef description,
|
||||
blender::StringRef socket_type,
|
||||
NodeTreeInterfaceSocketFlag flag,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
int position);
|
||||
|
@ -326,8 +326,8 @@ typedef struct bNodeTreeInterface {
|
|||
* \param parent: Panel in which the new panel is added as a child. If parent is null the new
|
||||
* panel is made a child of the root panel.
|
||||
*/
|
||||
bNodeTreeInterfacePanel *add_panel(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
bNodeTreeInterfacePanel *add_panel(blender::StringRef name,
|
||||
blender::StringRef description,
|
||||
NodeTreeInterfacePanelFlag flag,
|
||||
bNodeTreeInterfacePanel *parent);
|
||||
/**
|
||||
|
@ -336,8 +336,8 @@ typedef struct bNodeTreeInterface {
|
|||
* panel is made a child of the root panel.
|
||||
* \param position: Position of the child panel within the parent panel.
|
||||
*/
|
||||
bNodeTreeInterfacePanel *insert_panel(blender::StringRefNull name,
|
||||
blender::StringRefNull description,
|
||||
bNodeTreeInterfacePanel *insert_panel(blender::StringRef name,
|
||||
blender::StringRef description,
|
||||
NodeTreeInterfacePanelFlag flag,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
int position);
|
||||
|
|
|
@ -936,6 +936,6 @@ eRNAOverrideStatus RNA_property_override_library_status(struct Main *bmainm,
|
|||
int index);
|
||||
|
||||
void RNA_struct_state_owner_set(const char *name);
|
||||
const char *RNA_struct_state_owner_get(void);
|
||||
const char *RNA_struct_state_owner_get();
|
||||
|
||||
#endif /* __RNA_ACCESS_H__ */
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
/* Blender RNA */
|
||||
|
||||
BlenderRNA *RNA_create(void);
|
||||
BlenderRNA *RNA_create();
|
||||
void RNA_define_free(BlenderRNA *brna);
|
||||
void RNA_free(BlenderRNA *brna);
|
||||
|
||||
|
@ -53,8 +53,8 @@ void RNA_define_fallback_property_update(int noteflag, const char *updatefunc);
|
|||
*/
|
||||
void RNA_define_lib_overridable(bool make_overridable);
|
||||
|
||||
void RNA_init(void);
|
||||
void RNA_exit(void);
|
||||
void RNA_init();
|
||||
void RNA_exit();
|
||||
|
||||
/* Struct */
|
||||
|
||||
|
|
|
@ -434,11 +434,8 @@ static bNodeTreeInterfaceSocket *rna_NodeTreeInterfaceItems_new_socket(
|
|||
}
|
||||
const char *socket_type = typeinfo->idname;
|
||||
NodeTreeInterfaceSocketFlag flag = NodeTreeInterfaceSocketFlag(in_out);
|
||||
bNodeTreeInterfaceSocket *socket = interface->add_socket(name ? name : "",
|
||||
description ? description : "",
|
||||
socket_type ? socket_type : "",
|
||||
flag,
|
||||
parent);
|
||||
bNodeTreeInterfaceSocket *socket = interface->add_socket(
|
||||
name, description, socket_type, flag, parent);
|
||||
|
||||
if (socket == nullptr) {
|
||||
BKE_report(reports, RPT_ERROR, "Unable to create socket");
|
||||
|
|
|
@ -2067,7 +2067,7 @@ void WM_keymap_item_restore_to_default(wmWindowManager *wm, wmKeyMap *keymap, wm
|
|||
kmi->keymodifier = orig->keymodifier;
|
||||
kmi->maptype = orig->maptype;
|
||||
kmi->flag = (kmi->flag & ~(KMI_REPEAT_IGNORE | KMI_INACTIVE)) |
|
||||
(orig->flag & KMI_REPEAT_IGNORE);
|
||||
(orig->flag & (KMI_REPEAT_IGNORE | KMI_INACTIVE));
|
||||
|
||||
WM_keyconfig_update_tag(keymap, kmi);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue