From f681ce08c43b838f0141e8b4875bb10d0d6b1a69 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Wed, 5 Jun 2013 19:06:33 +0000 Subject: Fix #35640, part 2. Check id.lib in poll functions for operators which do critical modification of node trees (create nodes, link, etc.). Transform operators and hide/show type operators are still allowed, this does not modify actual behavior of the nodes and can be useful for inspecting linked nodes. --- release/scripts/startup/bl_operators/node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index 8217c401ede..7d09e1e759e 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -100,7 +100,7 @@ class NodeAddOperator(): def poll(cls, context): space = context.space_data # needs active node editor and a tree to add nodes to - return (space.type == 'NODE_EDITOR' and space.edit_tree) + return (space.type == 'NODE_EDITOR' and space.edit_tree and not space.edit_tree.library) # Default execute simply adds a node def execute(self, context): @@ -231,7 +231,7 @@ class NODE_OT_collapse_hide_unused_toggle(Operator): def poll(cls, context): space = context.space_data # needs active node editor and a tree - return (space.type == 'NODE_EDITOR' and space.edit_tree) + return (space.type == 'NODE_EDITOR' and space.edit_tree and not space.edit_tree.library) def execute(self, context): space = context.space_data -- cgit v1.2.3