[Bf-blender-cvs] [bb5da70] object_nodes: Fixed categories for nodes, so only the appropriate nodes for each tree type are used.

Lukas Tönne noreply at git.blender.org
Tue Nov 24 09:42:39 CET 2015


Commit: bb5da70b5d53af8e2b40dbff411c9d6c4687d227
Author: Lukas Tönne
Date:   Fri Jul 17 17:16:38 2015 +0200
Branches: object_nodes
https://developer.blender.org/rBbb5da70b5d53af8e2b40dbff411c9d6c4687d227

Fixed categories for nodes, so only the appropriate nodes for each tree
type are used.

===================================================================

M	release/scripts/startup/bl_operators/object_nodes.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/object_nodes.py b/release/scripts/startup/bl_operators/object_nodes.py
index c91f27d..689ff96 100644
--- a/release/scripts/startup/bl_operators/object_nodes.py
+++ b/release/scripts/startup/bl_operators/object_nodes.py
@@ -29,12 +29,22 @@ from nodeitems_utils import NodeCategory, NodeItem
 class ObjectNodeCategory(NodeCategory):
     @classmethod
     def poll(cls, context):
-        return context.space_data.tree_type == 'ObjectNodeTree'
+        tree = context.space_data.edit_tree
+        return tree and tree.bl_idname == 'ObjectNodeTree'
+
+class ForceFieldNodeCategory(NodeCategory):
+    @classmethod
+    def poll(cls, context):
+        tree = context.space_data.edit_tree
+        return tree and tree.bl_idname == 'ForceFieldNodeTree'
 
 node_categories = [
     ObjectNodeCategory("COMPONENTS", "Components", items=[
         NodeItem("ForceFieldNode"),
         ]),
+    ForceFieldNodeCategory("FORCE_FIELD", "Force Field", items=[
+        NodeItem("ForceForceNode"),
+        ]),
     ]
 
 ###############################################################################




More information about the Bf-blender-cvs mailing list