Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
| Show First 20 Lines • Show All 537 Lines • ▼ Show 20 Lines | if (has_object) { | ||||
| } | } | ||||
| id_node->has_base |= (base_index != -1); | id_node->has_base |= (base_index != -1); | ||||
| return; | return; | ||||
| } | } | ||||
| /* Create ID node for object and begin init. */ | /* Create ID node for object and begin init. */ | ||||
| IDNode *id_node = add_id_node(&object->id); | IDNode *id_node = add_id_node(&object->id); | ||||
| Object *object_cow = get_cow_datablock(object); | Object *object_cow = get_cow_datablock(object); | ||||
| id_node->linked_state = linked_state; | id_node->linked_state = linked_state; | ||||
| if (object == scene_->camera) { | /* NOTE: Scene is NULL when building dependency graph for render pipeline. | ||||
| * Probably need to assign that to something non-NULL, but then the logic here will still be | |||||
| * somewhat weird. */ | |||||
| if (scene_ != NULL && object == scene_->camera) { | |||||
| id_node->is_directly_visible = true; | id_node->is_directly_visible = true; | ||||
| } | } | ||||
| else { | else { | ||||
| id_node->is_directly_visible = is_visible; | id_node->is_directly_visible = is_visible; | ||||
| } | } | ||||
| id_node->has_base |= (base_index != -1); | id_node->has_base |= (base_index != -1); | ||||
| /* Various flags, flushing from bases/collections. */ | /* Various flags, flushing from bases/collections. */ | ||||
| build_object_flags(base_index, object, linked_state); | build_object_flags(base_index, object, linked_state); | ||||
| ▲ Show 20 Lines • Show All 806 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { | ||||
| else if (id_type == ID_IM) { | else if (id_type == ID_IM) { | ||||
| build_image((Image *)id); | build_image((Image *)id); | ||||
| } | } | ||||
| else if (id_type == ID_OB) { | else if (id_type == ID_OB) { | ||||
| /* TODO(sergey): Use visibility of owner of the node tree. */ | /* TODO(sergey): Use visibility of owner of the node tree. */ | ||||
| build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, true); | build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, true); | ||||
| } | } | ||||
| else if (id_type == ID_SCE) { | else if (id_type == ID_SCE) { | ||||
| /* Scenes are used by compositor trees, and handled by render | Scene *node_scene = (Scene *)id; | ||||
| * pipeline. No need to build dependencies for them here. */ | build_scene_parameters(node_scene); | ||||
| /* Camera is used by defocus node. | |||||
| * | |||||
| * On the one hand it's annoying to always pull it in, but on another hand it's also annoying | |||||
| * to have hardcoded node-type exception here. */ | |||||
| if (node_scene->camera != NULL) { | |||||
| /* TODO(sergey): Use visibility of owner of the node tree. */ | |||||
| build_object(-1, node_scene->camera, DEG_ID_LINKED_INDIRECTLY, true); | |||||
| } | |||||
| } | } | ||||
| else if (id_type == ID_TXT) { | else if (id_type == ID_TXT) { | ||||
| /* Ignore script nodes. */ | /* Ignore script nodes. */ | ||||
| } | } | ||||
| else if (id_type == ID_MSK) { | else if (id_type == ID_MSK) { | ||||
| build_mask((Mask *)id); | build_mask((Mask *)id); | ||||
| } | } | ||||
| else if (id_type == ID_MC) { | else if (id_type == ID_MC) { | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | void DepsgraphNodeBuilder::build_image(Image *image) | ||||
| if (built_map_.checkIsBuiltAndTag(image)) { | if (built_map_.checkIsBuiltAndTag(image)) { | ||||
| return; | return; | ||||
| } | } | ||||
| build_parameters(&image->id); | build_parameters(&image->id); | ||||
| add_operation_node( | add_operation_node( | ||||
| &image->id, NodeType::GENERIC_DATABLOCK, OperationCode::GENERIC_DATABLOCK_UPDATE); | &image->id, NodeType::GENERIC_DATABLOCK, OperationCode::GENERIC_DATABLOCK_UPDATE); | ||||
| } | } | ||||
| void DepsgraphNodeBuilder::build_compositor(Scene *scene) | |||||
| { | |||||
| /* For now, just a plain wrapper? */ | |||||
| // TODO: create compositing component? | |||||
| // XXX: component type undefined! | |||||
| // graph->get_node(&scene->id, NULL, NodeType::COMPOSITING, NULL); | |||||
| /* for now, nodetrees are just parameters; compositing occurs in internals | |||||
| * of renderer... */ | |||||
| add_component_node(&scene->id, NodeType::PARAMETERS); | |||||
| build_nodetree(scene->nodetree); | |||||
| } | |||||
| void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd) | void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(gpd)) { | if (built_map_.checkIsBuiltAndTag(gpd)) { | ||||
| return; | return; | ||||
| } | } | ||||
| ID *gpd_id = &gpd->id; | ID *gpd_id = &gpd->id; | ||||
| /* TODO(sergey): what about multiple users of same datablock? This should | /* TODO(sergey): what about multiple users of same datablock? This should | ||||
| ▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines | |||||