Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/node_geometry_tree.cc
| Show All 18 Lines | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "NOD_geometry.h" | #include "NOD_geometry.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
HooglyBoogly: Usually local includes go at the bottom of the list, so below "RNA_access.h" | |||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "node_common.h" | |||||
| bNodeTreeType *ntreeType_Geometry; | bNodeTreeType *ntreeType_Geometry; | ||||
| static void geometry_node_tree_get_from_context(const bContext *C, | static void geometry_node_tree_get_from_context(const bContext *C, | ||||
| bNodeTreeType *UNUSED(treetype), | bNodeTreeType *UNUSED(treetype), | ||||
| bNodeTree **r_ntree, | bNodeTree **r_ntree, | ||||
| ID **r_id, | ID **r_id, | ||||
| ID **r_from) | ID **r_from) | ||||
| { | { | ||||
| Show All 15 Lines | if (md->type == eModifierType_Nodes) { | ||||
| if (nmd->node_group != nullptr) { | if (nmd->node_group != nullptr) { | ||||
| *r_from = &ob->id; | *r_from = &ob->id; | ||||
| *r_id = &ob->id; | *r_id = &ob->id; | ||||
| *r_ntree = nmd->node_group; | *r_ntree = nmd->node_group; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void geometry_node_tree_update(bNodeTree *ntree) | |||||
Not Done Inline Actionsgeometry_node_tree_update would be more consistent with the other name in this file. HooglyBoogly: `geometry_node_tree_update` would be more consistent with the other name in this file. | |||||
| { | |||||
| /* Needed to give correct types to reroutes. */ | |||||
| ntree_update_reroute_nodes(ntree); | |||||
| } | |||||
| void register_node_tree_type_geo(void) | void register_node_tree_type_geo(void) | ||||
| { | { | ||||
| bNodeTreeType *tt = ntreeType_Geometry = static_cast<bNodeTreeType *>( | bNodeTreeType *tt = ntreeType_Geometry = static_cast<bNodeTreeType *>( | ||||
| MEM_callocN(sizeof(bNodeTreeType), "geometry node tree type")); | MEM_callocN(sizeof(bNodeTreeType), "geometry node tree type")); | ||||
| tt->type = NTREE_GEOMETRY; | tt->type = NTREE_GEOMETRY; | ||||
| strcpy(tt->idname, "GeometryNodeTree"); | strcpy(tt->idname, "GeometryNodeTree"); | ||||
| strcpy(tt->ui_name, N_("Geometry Node Editor")); | strcpy(tt->ui_name, N_("Geometry Node Editor")); | ||||
| tt->ui_icon = 0; /* defined in drawnode.c */ | tt->ui_icon = 0; /* defined in drawnode.c */ | ||||
| strcpy(tt->ui_description, N_("Geometry nodes")); | strcpy(tt->ui_description, N_("Geometry nodes")); | ||||
| tt->rna_ext.srna = &RNA_GeometryNodeTree; | tt->rna_ext.srna = &RNA_GeometryNodeTree; | ||||
| tt->update = geometry_node_tree_update; | |||||
| tt->get_from_context = geometry_node_tree_get_from_context; | tt->get_from_context = geometry_node_tree_get_from_context; | ||||
| ntreeTypeAdd(tt); | ntreeTypeAdd(tt); | ||||
| } | } | ||||
Usually local includes go at the bottom of the list, so below "RNA_access.h"