Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_stack.cc
- This file was added.
| /* SPDX-License-Identifier: GPL-2.0-or-later | |||||
| * Copyright 2022 Blender Foundation. All rights reserved. */ | |||||
sybren: Why is your code so old? So old!?! | |||||
Done Inline ActionsYeah, was waiting for a perfect moment to publish it, duuh :) sergey: Yeah, was waiting for a perfect moment to publish it, duuh :) | |||||
| /** \file | |||||
| * \ingroup depsgraph | |||||
| */ | |||||
| #include "intern/builder/deg_builder_stack.h" | |||||
| #include <iomanip> | |||||
| #include <iostream> | |||||
| #include "BKE_idtype.h" | |||||
| #include "DNA_ID.h" | |||||
| #include "DNA_action_types.h" | |||||
| #include "DNA_constraint_types.h" | |||||
| #include "DNA_modifier_types.h" | |||||
| namespace blender::deg { | |||||
| /* A guesstimate based on "Particle Settings" with some extra padding. */ | |||||
| constexpr int kPrintTypeWidth = 21; | |||||
Not Done Inline Actionstypo sybren: typo | |||||
| namespace { | |||||
| void print(std::ostream &stream, const ID *id) | |||||
| { | |||||
| const IDTypeInfo *id_type_info = BKE_idtype_get_info_from_id(id); | |||||
| stream << std::setw(kPrintTypeWidth) << id_type_info->name << " : " << (id->name + 2) << "\n"; | |||||
| } | |||||
| void print(std::ostream &stream, const bConstraint *constraint) | |||||
| { | |||||
| stream << std::setw(kPrintTypeWidth) << ("Constraint") << " : " << constraint->name << "\n"; | |||||
| } | |||||
| void print(std::ostream &stream, const ModifierData *modifier_data) | |||||
| { | |||||
| stream << std::setw(kPrintTypeWidth) << ("Modifier") << " : " << modifier_data->name << "\n"; | |||||
| } | |||||
| void print(std::ostream &stream, const bPoseChannel *pchan) | |||||
| { | |||||
| stream << std::setw(kPrintTypeWidth) << ("Pose Channel") << " : " << pchan->name << "\n"; | |||||
| } | |||||
| } // namespace | |||||
| void BuilderStack::print_backtrace(std::ostream &stream) | |||||
| { | |||||
| for (const Entry &entry : stack_) { | |||||
| if (entry.id_ != nullptr) { | |||||
| print(stream, entry.id_); | |||||
| } | |||||
| else if (entry.constraint_ != nullptr) { | |||||
| print(stream, entry.constraint_); | |||||
| } | |||||
| else if (entry.modifier_data_ != nullptr) { | |||||
| print(stream, entry.modifier_data_); | |||||
| } | |||||
| else if (entry.pchan_ != nullptr) { | |||||
| print(stream, entry.pchan_); | |||||
| } | |||||
| } | |||||
| } | |||||
| } // namespace blender::deg | |||||
Why is your code so old? So old!?!