diff options
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_rna.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_rna.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index d092240e665..853f8995d68 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -57,14 +57,14 @@ namespace DEG { class RNANodeQueryIDData { public: - explicit RNANodeQueryIDData(const ID *id) : id_(id), contraint_to_pchan_map_(NULL) + explicit RNANodeQueryIDData(const ID *id) : id_(id), contraint_to_pchan_map_(nullptr) { } ~RNANodeQueryIDData() { - if (contraint_to_pchan_map_ != NULL) { - BLI_ghash_free(contraint_to_pchan_map_, NULL, NULL); + if (contraint_to_pchan_map_ != nullptr) { + BLI_ghash_free(contraint_to_pchan_map_, nullptr, nullptr); } } @@ -76,13 +76,13 @@ class RNANodeQueryIDData { void ensure_constraint_to_pchan_map() { - if (contraint_to_pchan_map_ != NULL) { + if (contraint_to_pchan_map_ != nullptr) { return; } BLI_assert(GS(id_->name) == ID_OB); const Object *object = reinterpret_cast<const Object *>(id_); contraint_to_pchan_map_ = BLI_ghash_ptr_new("id data pchan constraint map"); - if (object->pose != NULL) { + if (object->pose != nullptr) { LISTBASE_FOREACH (const bPoseChannel *, pchan, &object->pose->chanbase) { LISTBASE_FOREACH (const bConstraint *, constraint, &pchan->constraints) { BLI_ghash_insert(contraint_to_pchan_map_, @@ -105,7 +105,7 @@ class RNANodeQueryIDData { /* ***************************** Node Identifier **************************** */ RNANodeIdentifier::RNANodeIdentifier() - : id(NULL), + : id(nullptr), type(NodeType::UNDEFINED), component_name(""), operation_code(OperationCode::OPERATION), @@ -116,7 +116,7 @@ RNANodeIdentifier::RNANodeIdentifier() bool RNANodeIdentifier::is_valid() const { - return id != NULL && type != NodeType::UNDEFINED; + return id != nullptr && type != NodeType::UNDEFINED; } /* ********************************** Query ********************************* */ @@ -140,7 +140,7 @@ RNANodeQuery::RNANodeQuery(Depsgraph *depsgraph, DepsgraphBuilder *builder) RNANodeQuery::~RNANodeQuery() { - BLI_ghash_free(id_data_map_, NULL, ghash_id_data_free_func); + BLI_ghash_free(id_data_map_, nullptr, ghash_id_data_free_func); } Node *RNANodeQuery::find_node(const PointerRNA *ptr, @@ -149,16 +149,16 @@ Node *RNANodeQuery::find_node(const PointerRNA *ptr, { const RNANodeIdentifier node_identifier = construct_node_identifier(ptr, prop, source); if (!node_identifier.is_valid()) { - return NULL; + return nullptr; } IDNode *id_node = depsgraph_->find_id_node(node_identifier.id); - if (id_node == NULL) { - return NULL; + if (id_node == nullptr) { + return nullptr; } ComponentNode *comp_node = id_node->find_component(node_identifier.type, node_identifier.component_name); - if (comp_node == NULL) { - return NULL; + if (comp_node == nullptr) { + return nullptr; } if (node_identifier.operation_code == OperationCode::OPERATION) { return comp_node; @@ -173,7 +173,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, RNAPointerSource source) { RNANodeIdentifier node_identifier; - if (ptr->type == NULL) { + if (ptr->type == nullptr) { return node_identifier; } /* Set default values for returns. */ @@ -183,7 +183,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.operation_name = ""; node_identifier.operation_name_tag = -1; /* Handling of commonly known scenarios. */ - if (prop != NULL && RNA_property_is_idprop(prop)) { + if (prop != nullptr && RNA_property_is_idprop(prop)) { node_identifier.type = NodeType::PARAMETERS; node_identifier.operation_code = OperationCode::ID_PROPERTY; node_identifier.operation_name = RNA_property_identifier( @@ -196,7 +196,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.type = NodeType::BONE; node_identifier.component_name = pchan->name; /* However check property name for special handling. */ - if (prop != NULL) { + if (prop != nullptr) { 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. */ @@ -245,7 +245,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, * at a given constraint, but for rigging one might use constraint * influence to be used to drive some corrective shape keys or so. */ const bPoseChannel *pchan = id_data->get_pchan_for_constraint(constraint); - if (pchan == NULL) { + if (pchan == nullptr) { node_identifier.type = NodeType::TRANSFORM; node_identifier.operation_code = OperationCode::TRANSFORM_LOCAL; } @@ -260,10 +260,10 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, Object *object = reinterpret_cast<Object *>(ptr->owner_id); bConstraintTarget *tgt = (bConstraintTarget *)ptr->data; /* Check whether is object or bone constraint. */ - bPoseChannel *pchan = NULL; + bPoseChannel *pchan = nullptr; bConstraint *con = BKE_constraint_find_from_target(object, tgt, &pchan); - if (con != NULL) { - if (pchan != NULL) { + if (con != nullptr) { + if (pchan != nullptr) { node_identifier.type = NodeType::BONE; node_identifier.operation_code = OperationCode::BONE_LOCAL; node_identifier.component_name = pchan->name; @@ -299,7 +299,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } else if (ptr->type == &RNA_Object) { /* Transforms props? */ - if (prop != NULL) { + if (prop != nullptr) { const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop); /* TODO(sergey): How to optimize this? */ if (strstr(prop_identifier, "location") || strstr(prop_identifier, "rotation") || @@ -370,7 +370,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.type = NodeType::GEOMETRY; return node_identifier; } - if (prop != NULL) { + if (prop != nullptr) { /* All unknown data effectively falls under "parameter evaluation". */ node_identifier.type = NodeType::PARAMETERS; node_identifier.operation_code = OperationCode::PARAMETERS_EVAL; |