Discussion:
[Bf-python] Error when running nodes.new() in currrent SVN
Peter D. Cassetta
2013-04-27 00:46:28 UTC
Permalink
Hi all,

I am encountering an error when adding new nodes to a material's node
tree (via Python).

I know there have been some API changes recently; I just rebuilt Blender
from SVN yesterday.
Here is the code I am running and the error I am getting.
C.object.active_material.node_tree.nodes.new('MIX_SHADER')
Traceback (most recent call last):
File "/opt/blender-svn/2.66/python/lib/python3.3/code.py", line 90, in runcode
exec(code, self.locals)
File "<blender_console>", line 1, in <module>
RuntimeError: Error: Node type MIX_SHADER undefined


Is nodes.new() deprecated, or just broken at the moment?
I am getting this error for any node type, by the way.

Also, do I need to change my code to fix this, or just wait a bit?
Thanks for any assistance!

-Peter Cassetta
INTERLICHTSPIELHAUS
2013-04-27 04:51:46 UTC
Permalink
this should set you on you way

http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes/API_changes

regards
inS
On Apr 27, 2013 2:46 AM, "Peter D. Cassetta" <peter at fingertipsoft.com>
Post by Peter D. Cassetta
Hi all,
I am encountering an error when adding new nodes to a material's node
tree (via Python).
I know there have been some API changes recently; I just rebuilt Blender
from SVN yesterday.
Here is the code I am running and the error I am getting.
C.object.active_material.node_tree.nodes.new('MIX_SHADER')
File "/opt/blender-svn/2.66/python/lib/python3.3/code.py", line 90, in runcode
exec(code, self.locals)
File "<blender_console>", line 1, in <module>
RuntimeError: Error: Node type MIX_SHADER undefined
Is nodes.new() deprecated, or just broken at the moment?
I am getting this error for any node type, by the way.
Also, do I need to change my code to fix this, or just wait a bit?
Thanks for any assistance!
-Peter Cassetta
_______________________________________________
Bf-python mailing list
Bf-python at blender.org
http://lists.blender.org/mailman/listinfo/bf-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-python/attachments/20130427/e2ae9180/attachment.htm
Loading...