diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-03-19 17:40:16 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-03-19 17:40:16 +0400 |
commit | bbac76ee2669481132f69fee45b9086a5bd4c695 (patch) | |
tree | 193f03631a900b3e3d4d1cc20f6e18be1c7c72ca /source/blender/editors/screen/screen_ops.c | |
parent | c9d981c86da7b3a580410a27afdec1e67f446a48 (diff) |
Nicer handling of undefined node, tree and socket types.
When nodes are loaded from a .blend file they can potentially have undefined types. This can happen if a type has been deprecated and removed, or if node types were defined in a python script that has not been loaded correctly. Previously all such nodes would automatically be removed from a node tree, assuming that their types were deprecated and no longer in use (more commonly caused by loading new nodes in an older Blender version). Due to the possibility of dynamic registration it is no longer feasible to simply delete such nodes.
Display and handling of node trees was simply disabled before this patch, so that a node tree where any node or socket type was undefined would not be displayed at all. To give more information and avoid problems caused by necessary checks for the typeinfo pointer, there is now a 'Undefined' fallback type for trees, nodes and sockets. These types are used as placeholders in case the real type is not registered and can provide useful visual feedback on undefined nodes.
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 8b69e6e831d..d5d5add215c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -254,7 +254,7 @@ int ED_operator_node_active(bContext *C) { SpaceNode *snode = CTX_wm_space_node(C); - if (snode && ntreeIsValid(snode->edittree)) + if (snode && snode->edittree) return 1; return 0; |