Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/space_node.c
| Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH_INDEX (bNodeTreePath *, path, &snode->treepath, i) { | ||||
| } | } | ||||
| else { | else { | ||||
| sprintf(value, "/%s", path->display_name); | sprintf(value, "/%s", path->display_name); | ||||
| value += strlen(path->display_name) + 1; | value += strlen(path->display_name) + 1; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void ED_node_tree_path_get_fixedbuf(SpaceNode *snode, char *value, int max_length) | |||||
| { | |||||
| int size; | |||||
| value[0] = '\0'; | |||||
| int i = 0; | |||||
| LISTBASE_FOREACH_INDEX (bNodeTreePath *, path, &snode->treepath, i) { | |||||
| if (i == 0) { | |||||
| size = BLI_strncpy_rlen(value, path->display_name, max_length); | |||||
| } | |||||
| else { | |||||
| size = BLI_snprintf_rlen(value, max_length, "/%s", path->display_name); | |||||
| } | |||||
| max_length -= size; | |||||
| if (max_length <= 0) { | |||||
| break; | |||||
| } | |||||
| value += size; | |||||
| } | |||||
| } | |||||
| void ED_node_set_active_viewer_key(SpaceNode *snode) | void ED_node_set_active_viewer_key(SpaceNode *snode) | ||||
| { | { | ||||
| bNodeTreePath *path = snode->treepath.last; | bNodeTreePath *path = snode->treepath.last; | ||||
| if (snode->nodetree && path) { | if (snode->nodetree && path) { | ||||
| snode->nodetree->active_viewer_key = path->parent_key; | snode->nodetree->active_viewer_key = path->parent_key; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 877 Lines • Show Last 20 Lines | |||||