Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.cc
| Show First 20 Lines • Show All 1,699 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| const geo_log::GeoTreeLog *tree_log = tree_draw_ctx.geo_tree_log; | const geo_log::GeoTreeLog *tree_log = tree_draw_ctx.geo_tree_log; | ||||
| if (tree_log == nullptr) { | if (tree_log == nullptr) { | ||||
| return std::nullopt; | return std::nullopt; | ||||
| } | } | ||||
| if (node.type == NODE_GROUP_OUTPUT) { | if (node.type == NODE_GROUP_OUTPUT) { | ||||
| return tree_log->run_time_sum; | return tree_log->run_time_sum; | ||||
| } | } | ||||
| if (node.type == NODE_FRAME) { | else if (node.is_frame()) { | ||||
| /* Could be cached in the future if this recursive code turns out to be slow. */ | /* Could be cached in the future if this recursive code turns out to be slow. */ | ||||
| std::chrono::nanoseconds run_time{0}; | std::chrono::nanoseconds run_time{0}; | ||||
| bool found_node = false; | bool found_node = false; | ||||
| LISTBASE_FOREACH (bNode *, tnode, &ntree.nodes) { | |||||
| if (tnode->parent != &node) { | |||||
| continue; | |||||
| } | |||||
| if (tnode->type == NODE_FRAME) { | for (const bNode *tnode : node.direct_children_in_frame()) { | ||||
| if (tnode->is_frame()) { | |||||
| std::optional<std::chrono::nanoseconds> sub_frame_run_time = node_get_execution_time( | std::optional<std::chrono::nanoseconds> sub_frame_run_time = node_get_execution_time( | ||||
| tree_draw_ctx, ntree, *tnode); | tree_draw_ctx, ntree, *tnode); | ||||
| if (sub_frame_run_time.has_value()) { | if (sub_frame_run_time.has_value()) { | ||||
| run_time += *sub_frame_run_time; | run_time += *sub_frame_run_time; | ||||
| found_node = true; | found_node = true; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 1,517 Lines • Show Last 20 Lines | |||||