diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-01-24 14:49:49 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-01-24 14:49:49 +0300 |
commit | 11df5443e5d062e5a08714433eed37b9a78c15ba (patch) | |
tree | ed6e2b692a8dba659db40589c560762b9ee92d3f /source | |
parent | cf84db61a6baf160fc3521e5b5a4121609b9ea8d (diff) | |
parent | 18343c230d2c447f61fb60994b107f6a1adc01e7 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_idprop.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 15 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_rna.cc | 80 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 60 | ||||
-rw-r--r-- | source/blender/usd/CMakeLists.txt | 31 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 8 |
6 files changed, 120 insertions, 76 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 94c2a94d420..2b02895043f 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -83,6 +83,8 @@ void IDP_FreeString(struct IDProperty *prop) ATTR_NONNULL(); typedef void (*IDPWalkFunc)(void *userData, IDProperty *idp); +void IDP_AssignID(IDProperty *prop, ID *id, const int flag); + /*-------- Group Functions -------*/ /** Sync values from one group to another, only where they match */ diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 1125047be32..e3b27236616 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -461,6 +461,21 @@ static IDProperty *IDP_CopyID(const IDProperty *prop, const int flag) return newp; } +void IDP_AssignID(IDProperty *prop, ID *id, const int flag) +{ + BLI_assert(prop->type == IDP_ID); + + if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0 && IDP_Id(prop) != NULL) { + id_us_min(IDP_Id(prop)); + } + + prop->data.pointer = id; + + if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) { + id_us_plus(IDP_Id(prop)); + } +} + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index 180499519f6..d092240e665 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -183,44 +183,42 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.operation_name = ""; node_identifier.operation_name_tag = -1; /* Handling of commonly known scenarios. */ - if (ptr->type == &RNA_PoseBone) { + if (prop != NULL && RNA_property_is_idprop(prop)) { + node_identifier.type = NodeType::PARAMETERS; + node_identifier.operation_code = OperationCode::ID_PROPERTY; + node_identifier.operation_name = RNA_property_identifier( + reinterpret_cast<const PropertyRNA *>(prop)); + return node_identifier; + } + else if (ptr->type == &RNA_PoseBone) { const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data); - if (prop != NULL && RNA_property_is_idprop(prop)) { - node_identifier.type = NodeType::PARAMETERS; - node_identifier.operation_code = OperationCode::ID_PROPERTY; - node_identifier.operation_name = RNA_property_identifier( - reinterpret_cast<const PropertyRNA *>(prop)); - node_identifier.operation_name_tag = -1; - } - else { - /* Bone - generally, we just want the bone component. */ - node_identifier.type = NodeType::BONE; - node_identifier.component_name = pchan->name; - /* However check property name for special handling. */ - if (prop != NULL) { - Object *object = reinterpret_cast<Object *>(node_identifier.id); - const char *prop_name = RNA_property_identifier(prop); - /* B-Bone properties should connect to the final operation. */ - if (STRPREFIX(prop_name, "bbone_")) { - if (builder_->check_pchan_has_bbone_segments(object, pchan)) { - node_identifier.operation_code = OperationCode::BONE_SEGMENTS; - } - else { - node_identifier.operation_code = OperationCode::BONE_DONE; - } - } - /* Final transform properties go to the Done node for the exit. */ - else if (STREQ(prop_name, "head") || STREQ(prop_name, "tail") || - STREQ(prop_name, "length") || STRPREFIX(prop_name, "matrix")) { - if (source == RNAPointerSource::EXIT) { - node_identifier.operation_code = OperationCode::BONE_DONE; - } + /* Bone - generally, we just want the bone component. */ + node_identifier.type = NodeType::BONE; + node_identifier.component_name = pchan->name; + /* However check property name for special handling. */ + if (prop != NULL) { + Object *object = reinterpret_cast<Object *>(node_identifier.id); + const char *prop_name = RNA_property_identifier(prop); + /* B-Bone properties should connect to the final operation. */ + if (STRPREFIX(prop_name, "bbone_")) { + if (builder_->check_pchan_has_bbone_segments(object, pchan)) { + node_identifier.operation_code = OperationCode::BONE_SEGMENTS; } - /* And other properties can always go to the entry operation. */ else { - node_identifier.operation_code = OperationCode::BONE_LOCAL; + node_identifier.operation_code = OperationCode::BONE_DONE; } } + /* Final transform properties go to the Done node for the exit. */ + else if (STREQ(prop_name, "head") || STREQ(prop_name, "tail") || + STREQ(prop_name, "length") || STRPREFIX(prop_name, "matrix")) { + if (source == RNAPointerSource::EXIT) { + node_identifier.operation_code = OperationCode::BONE_DONE; + } + } + /* And other properties can always go to the entry operation. */ + else { + node_identifier.operation_code = OperationCode::BONE_LOCAL; + } } return node_identifier; } @@ -374,18 +372,10 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } if (prop != NULL) { /* All unknown data effectively falls under "parameter evaluation". */ - if (RNA_property_is_idprop(prop)) { - node_identifier.type = NodeType::PARAMETERS; - node_identifier.operation_code = OperationCode::ID_PROPERTY; - node_identifier.operation_name = RNA_property_identifier((PropertyRNA *)prop); - node_identifier.operation_name_tag = -1; - } - else { - node_identifier.type = NodeType::PARAMETERS; - node_identifier.operation_code = OperationCode::PARAMETERS_EVAL; - node_identifier.operation_name = ""; - node_identifier.operation_name_tag = -1; - } + node_identifier.type = NodeType::PARAMETERS; + node_identifier.operation_code = OperationCode::PARAMETERS_EVAL; + node_identifier.operation_name = ""; + node_identifier.operation_name_tag = -1; return node_identifier; } return node_identifier; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d8889455ac7..bd2e522c4b4 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3762,25 +3762,59 @@ void RNA_property_pointer_set(PointerRNA *ptr, ReportList *reports) { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; + IDProperty *idprop = rna_idproperty_check(&prop, ptr); BLI_assert(RNA_property_type(prop) == PROP_POINTER); - /* Check types */ - if (ptr_value.type != NULL && !RNA_struct_is_a(ptr_value.type, pprop->type)) { - BKE_reportf(reports, - RPT_ERROR, - "%s: expected %s type, not %s.\n", - __func__, - pprop->type->identifier, - ptr_value.type->identifier); - return; + /* Check types. */ + if (pprop->set != NULL) { + /* Assigning to a real RNA property. */ + if (ptr_value.type != NULL && !RNA_struct_is_a(ptr_value.type, pprop->type)) { + BKE_reportf(reports, + RPT_ERROR, + "%s: expected %s type, not %s.\n", + __func__, + pprop->type->identifier, + ptr_value.type->identifier); + return; + } + } + else { + /* Assigning to an IDProperty desguised as RNA one. */ + if (ptr_value.type != NULL && !RNA_struct_is_a(ptr_value.type, &RNA_ID)) { + BKE_reportf(reports, + RPT_ERROR, + "%s: expected ID type, not %s.\n", + __func__, + ptr_value.type->identifier); + return; + } } - /* RNA */ - if (pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && - !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) { + /* We got an existing IDProperty. */ + if (idprop != NULL) { + /* Not-yet-defined ID IDProps have an IDP_GROUP type, not an IDP_ID one - because of reasons? + * XXX This has to be investigated fully - there might be a good reason for it, but off hands + * this seems really weird... */ + if (idprop->type == IDP_ID) { + IDP_AssignID(idprop, ptr_value.data, 0); + rna_idproperty_touch(idprop); + } + else { + BLI_assert(idprop->type == IDP_GROUP); + + IDPropertyTemplate val = {.id = ptr_value.data}; + IDProperty *group = RNA_struct_idprops(ptr, true); + BLI_assert(group != NULL); + + IDP_ReplaceInGroup_ex(group, IDP_New(IDP_ID, &val, idprop->name), idprop); + } + } + /* RNA property. */ + else if (pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && + !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) { pprop->set(ptr, ptr_value, reports); } - /* IDProperty */ + /* IDProperty desguised as RNA property (and not yet defined in ptr). */ else if (prop->flag & PROP_EDITABLE) { IDPropertyTemplate val = {0}; IDProperty *group; diff --git a/source/blender/usd/CMakeLists.txt b/source/blender/usd/CMakeLists.txt index 1d72593f829..f4cf53e573f 100644 --- a/source/blender/usd/CMakeLists.txt +++ b/source/blender/usd/CMakeLists.txt @@ -78,29 +78,11 @@ set(LIB bf_blenlib ) -# Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives -if(WIN32) - list(APPEND LIB - ${USD_LIBRARIES} - ) -elseif(CMAKE_COMPILER_IS_GNUCXX) - list(APPEND LIB - -Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive - ) -elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - list(APPEND LIB - -Wl,-force_load ${USD_LIBRARIES} - ) -else() - message(FATAL_ERROR "Unknown how to link USD with your compiler ${CMAKE_CXX_COMPILER_ID}") -endif() - list(APPEND LIB ${BOOST_LIBRARIES} ) list(APPEND LIB - ${TBB_LIBRARIES} ) blender_add_lib(bf_usd "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") @@ -111,3 +93,16 @@ if(WIN32) set_property(TARGET bf_usd APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /WHOLEARCHIVE:${USD_RELEASE_LIB}") set_property(TARGET bf_usd APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /WHOLEARCHIVE:${USD_RELEASE_LIB}") endif() + +# Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives +if(WIN32) + target_link_libraries(bf_usd ${USD_LIBRARIES}) +elseif(CMAKE_COMPILER_IS_GNUCXX) + target_link_libraries(bf_usd "-Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive ${TBB_LIBRARIES}") +elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + target_link_libraries(bf_usd -Wl,-force_load ${USD_LIBRARIES}) +else() + message(FATAL_ERROR "Unknown how to link USD with your compiler ${CMAKE_CXX_COMPILER_ID}") +endif() + +target_link_libraries(bf_usd ${TBB_LIBRARIES}) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index d2af282f9a4..82c45b4fe64 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -38,6 +38,14 @@ blender_include_dirs( ) set(LIB + # This forces TBB libraries to be in front of MKL (which is a part of OpenImageDenoise). + # + # The need of this comes to need to ensure static libraries initialization order, making it + # so TBB is initialized prior to MKL (or any other dpeendnecy). + # + # This isn't fully robust but seems to work. + ${TBB_LIBRARIES} + bf_windowmanager ) |