Discussion:
[Bf-python] PyNodes NodeTree
Александр Недовизин
2013-08-22 07:00:26 UTC
Permalink
Hello everyone!
1) Where can I get a description of the module "nodeitems_utils"?
2) how to get the current Nodetree (PyNode) from context?
There bpy.context.blend_data.node_groups, again, is a collection (array). And need a particular?NodeTree.
3) And how can you use the method get_from_context not clear. My attempts have failed.

http://www.blender.org/documentation/blender_python_api_2_68_release/bpy.types.NodeTree.html#bpy.types.NodeTree
When this method works and how to use it??
--
Alexander Nedovizin
(Russia)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-python/attachments/20130822/924c045c/attachment.htm
Paul Kilgo
2013-08-22 10:32:13 UTC
Permalink
Hi Alexander

1) I asked this to #blender-coders not too long ago and the consensus
seemed to be to just read the module itself. The primary use I know of is
for building the "Add Node" menu (for when you Shift+A). I have an example
of its basic usage here if you like:

https://gist.github.com/OEP/5978445

2) Someone else is probably better suited to answer this question, but I
worked on PyNodes over the summer and did not ever figure this out. The
best I could do was figure out which nodes (in ALL trees) were selected
using the ".selected" property

3) Oh, this could be your answer to #2, I don't think that was in the
2.67-level API. Just a guess, I don't have 2.68 installed, but it looks
like its usage is:

tree, owner, selected = bpy.types.NodeTree.get_from_context(context)

Hopefully this helps!
Post by Александр Недовизин
Hello everyone!
1) Where can I get a description of the module "nodeitems_utils"?
2) how to get the current Nodetree (PyNode) from context?
There bpy.context.blend_data.node_groups, again, is a collection (array).
And need a particular NodeTree.
3) And how can you use the method get_from_context not clear. My attempts have failed.
http://www.blender.org/documentation/blender_python_api_2_68_release/bpy.types.NodeTree.html#bpy.types.NodeTree
When this method works and how to use it?
--
Alexander Nedovizin
(Russia)
_______________________________________________
Bf-python mailing list
Bf-python at blender.org
http://lists.blender.org/mailman/listinfo/bf-python
--
Paul Kilgo
paulkilgo at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-python/attachments/20130822/c017e113/attachment.htm
Alexander Nedovizin
2013-08-22 12:22:58 UTC
Permalink
1) The code I've seen for a long time. I ask for more information on this
module.

2) a pity that there is no context

3) proposed an alternative you are not working.

My script is working, but I would like to improve the code.





--
View this message in context: http://blender.45788.x6.nabble.com/PyNodes-NodeTree-tp112535p112542.html
Sent from the Bf-python mailing list archive at Nabble.com.

Loading...