﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.4%2FSource%2FPython%2FNodes_-_Blender_2.49</id>
	<title>Dev:2.4/Source/Python/Nodes - Blender 2.49 - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.4%2FSource%2FPython%2FNodes_-_Blender_2.49"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/Nodes_-_Blender_2.49&amp;action=history"/>
	<updated>2026-06-02T14:24:55Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/Nodes_-_Blender_2.49&amp;diff=46322&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/Nodes_-_Blender_2.49&amp;diff=46322&amp;oldid=prev"/>
		<updated>2018-06-28T17:47:15Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 17:47時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/Nodes_-_Blender_2.49&amp;diff=46321&amp;oldid=prev</id>
		<title>wiki&gt;Mindrones bot: Bot: Fixing redirects</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/Nodes_-_Blender_2.49&amp;diff=46321&amp;oldid=prev"/>
		<updated>2010-05-27T08:25:33Z</updated>

		<summary type="html">&lt;p&gt;Bot: Fixing redirects&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Project status: {{inprogress|75|committed to Blender svn trunk on Feb 09}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Current State ==&lt;br /&gt;
&lt;br /&gt;
{{Note|.blend file|[[Media:Dev-pynodes-test.blend]]}}&lt;br /&gt;
{{Note|.blend file|[[Media:Dev-pynodes-test_halftone.blend]] (this file contains a NPR-type shader. It's by me, jesterKing, so the code may not be all too beautiful ;)}}&lt;br /&gt;
&lt;br /&gt;
PyNodes are now available in the main Blender development version (svn trunk). Only shader pynodes work for now, accessible from the list of node types in the Nodes window, as &amp;quot;Dynamic&amp;quot; nodes.&lt;br /&gt;
&lt;br /&gt;
This page explains how to write pynode scripts:&lt;br /&gt;
&lt;br /&gt;
* [[Dev:2.4/Py/Nodes/API|PyNodes API discussion]]&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* All Python in Blender had to be updated to support threads. This is an important update that needs to be well tested, it affects every use of scripting in Blender, except the game engine.&lt;br /&gt;
* The API is not final yet, a few small changes can occur.&lt;br /&gt;
* More ShadeInput (shi) data will be made accessible to pynodes.&lt;br /&gt;
* Composite pynodes should be added as soon as possible.&lt;br /&gt;
&lt;br /&gt;
Known problems:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strike&amp;gt;A patch '''[http://www.letworyinteractive.com/blender/r13811_pythonthread.patch here]''' (against r13811) should fix this problem. Do test. &amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;Crash when rendering with more than one thread. Investigating. Disabling pynodes execution when using more than one thread for rendering. This prevents the crashes while a proper fix isn't implemented. Thanks jensverwiebe for testing and reporting and ibkanat for confirming, both in #blendercoders.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Development Information ==&lt;br /&gt;
&lt;br /&gt;
 Warning: some parts of the sections below are outdated&lt;br /&gt;
&lt;br /&gt;
Add bug reports to [[Dev:2.4/Py/Nodes/Bugs|BlenderDev/PyNodes/Bugs]]&lt;br /&gt;
&lt;br /&gt;
From the patch tracker:&lt;br /&gt;
&amp;quot;This patch adds Python Nodes to the shader tree. An example .blend will be added to play with. It'll show the format of the script for Python Nodes (basically a class with two functions implemented).&lt;br /&gt;
&lt;br /&gt;
When an empty script node is added, you can choose a script for it. This script defines both the input and output sockets and the execution body. After initialisation, the new typeinfo will be added to the tree's alltypes, and from then on can be added also from the add menu &amp;quot;Dynamic &amp;gt; MyScriptNode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Nodes can be updated on the fly (see http://www.letwory.net/downloads/rt/sockupdate.html). They work after instantiation just like any other node, so they can be appended and grouped and whatnot (see also http://www.letwory.net/downloads/rt/gridgroup.html).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;For this to work there has been some changes as how the typeinfos internally are kept: from a static global array to a ListBase in the ntree itself. This in itself is not necessarily the best way, since atm you'll see only added script nodes for the tree being edited, but that shouldn't be the biggest issue now (but will be tackled).&amp;lt;/strike&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==PyNodes: What are they==&lt;br /&gt;
Python nodes give the user a means of creating quickly new nodes to use in a shader tree (and in the future also in the node compositor).&lt;br /&gt;
&lt;br /&gt;
Through a fairly simple interface such a node can be created, added to a tree and used like any other node.&lt;br /&gt;
&lt;br /&gt;
Most important feature is that one can quickly develop/prototype new shaders, which might later on be written in C for better performance.&lt;br /&gt;
&lt;br /&gt;
Since the execution code is run through Python, you'll see lower performance, but it should still be quite ok to use. When you have a fully developed python node script and you use it a lot, it would be good to consider rewriting it in C.&lt;br /&gt;
&lt;br /&gt;
==PyNodes: The internals==&lt;br /&gt;
Add pictures explaining the internal workings&lt;br /&gt;
&lt;br /&gt;
* adding from empty script node&lt;br /&gt;
* loading from .blender&lt;br /&gt;
* updating existing script node&lt;br /&gt;
&lt;br /&gt;
* creating the typeinfo&lt;br /&gt;
* populating the typeinfo-&amp;gt;inputs and typeinfo-&amp;gt;outputs&lt;br /&gt;
&lt;br /&gt;
* execution model&lt;br /&gt;
&lt;br /&gt;
[[User:JesterKing|/Nathan]]&lt;br /&gt;
&lt;br /&gt;
== PyNodes: Finishing ==&lt;br /&gt;
&lt;br /&gt;
[[User:JesterKing|Nathan]] is too busy at the moment and can't dedicate enough time to PyNodes. [[User:ianwill|Willian]] (that's me) offered to help where possible.&lt;br /&gt;
&lt;br /&gt;
=== Files ===&lt;br /&gt;
&lt;br /&gt;
Collecting here the names of PyNodes related files, as I check them (list is not complete nor in proper order):&lt;br /&gt;
&lt;br /&gt;
In source/blender/:&lt;br /&gt;
&lt;br /&gt;
* In nodes/:&lt;br /&gt;
** intern/SHD_nodes/SHD_dynamic.c&lt;br /&gt;
* In src/:&lt;br /&gt;
** drawnode.c&lt;br /&gt;
** editnode.c&lt;br /&gt;
* In blenkernel/:&lt;br /&gt;
** BKE_node.h&lt;br /&gt;
** intern/node.c&lt;br /&gt;
&lt;br /&gt;
=== Tests ===&lt;br /&gt;
&lt;br /&gt;
==== Randomized pixels ====&lt;br /&gt;
&lt;br /&gt;
Simplistic test to get a feel of how to write a pynodes script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Randomized pixels, Color -&amp;gt; Color&lt;br /&gt;
&lt;br /&gt;
from Blender import Node&lt;br /&gt;
from Blender.Noise import random&lt;br /&gt;
&lt;br /&gt;
class MyNode(Node.node):&lt;br /&gt;
	&lt;br /&gt;
	def __init__(self, sockets):&lt;br /&gt;
		col = ['col', Node.RGBA, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0]&lt;br /&gt;
		sockets.input = [col]&lt;br /&gt;
		sockets.output = [col]&lt;br /&gt;
&lt;br /&gt;
	def __call__(self):&lt;br /&gt;
		ocol = list(self.input['col'])&lt;br /&gt;
		ocol[0] *= random()&lt;br /&gt;
		ocol[1] *= random()&lt;br /&gt;
		ocol[2] *= random()&lt;br /&gt;
		self.output['col'] = ocol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
Open Blender with default scene plus the randomize pixels script written above and a node material for the default cube.&lt;br /&gt;
&lt;br /&gt;
Open Blender. Select some object and add a material to it. Make sure material is node based one (&amp;quot;Nodes&amp;quot; button in the material settings). Open the script in Blender's text editor. Open the node editor. Add a dynamic node to the node network. The node should have a file selector. You should see the file opened in the text editor there. Select it. Build your node setup as usual after this.&lt;br /&gt;
&lt;br /&gt;
Note that if you make changes to a PyNode script, you need to hit the &amp;quot;Update&amp;quot; button found in the node.&lt;br /&gt;
&lt;br /&gt;
UPDATES:&lt;br /&gt;
&lt;br /&gt;
* Basically it works, needs more testing and small additions here and there: access to more data, interface polish, etc.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
&lt;br /&gt;
# Sync to current Blender trunk SVN -- Done by [[User:JesterKing|Nathan]]&lt;br /&gt;
# Understand well the PyNodes system: ideas, how it works, how it was implemented. Done.&lt;br /&gt;
# Test, fix bugs&lt;br /&gt;
# Implement missing bits&lt;br /&gt;
# Update to follow current BPython guidelines&lt;br /&gt;
# Get some examples and user documentation done&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
* Check the [[Dev:2.4/Py/Nodes/API|BlenderDev/PyNodes/API]] page for current info on how to write a shader pynode.&lt;br /&gt;
&lt;br /&gt;
[[User:Ianwill|Willian]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mindrones bot</name></author>
		
	</entry>
</feed>