﻿<?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=Extensions%3A2.4%2FPy%2FNodes%2FCookbook%2FTemplates</id>
	<title>Extensions:2.4/Py/Nodes/Cookbook/Templates - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Extensions%3A2.4%2FPy%2FNodes%2FCookbook%2FTemplates"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Extensions:2.4/Py/Nodes/Cookbook/Templates&amp;action=history"/>
	<updated>2026-04-22T03:55:55Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Extensions:2.4/Py/Nodes/Cookbook/Templates&amp;diff=59520&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Extensions:2.4/Py/Nodes/Cookbook/Templates&amp;diff=59520&amp;oldid=prev"/>
		<updated>2018-06-28T17:54:37Z</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:54時点における版&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=Extensions:2.4/Py/Nodes/Cookbook/Templates&amp;diff=59519&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=Extensions:2.4/Py/Nodes/Cookbook/Templates&amp;diff=59519&amp;oldid=prev"/>
		<updated>2010-05-26T17:16:02Z</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;[[Extensions:2.4/Py/Nodes/Cookbook|Back to index]]&lt;br /&gt;
&lt;br /&gt;
=== Basic template ===&lt;br /&gt;
This is the very basic template you can use as a basis for a script. Please see the [[Dev:2.4/Py/Nodes/API|API]] for more information about socket definitions and the functionality overall.&lt;br /&gt;
&lt;br /&gt;
You can get a .blend containing a basic scene in which to develop PyNodes [[http://wiki.blender.org/uploads/7/7d/Pynode-template.blend here]]. It contains two screens. Use ctrl-right, ctrl-left or the screen selector to move between them. Other is meant for setting up the node setup and other for altering the scene should it be necessary.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# John Doe 2008&lt;br /&gt;
# State license used here and provide a link to it if you want to use one&lt;br /&gt;
from Blender import Node&lt;br /&gt;
&lt;br /&gt;
class TemplateNode(Node.Scripted): # change TemplateNode to match the name of your node&lt;br /&gt;
    def __init__(self, sockets):&lt;br /&gt;
        sockets.input = [Node.Socket('Color', val = 4*[1.0])] # define inputs here&lt;br /&gt;
        sockets.output = [Node.Socket('Color', val = 4*[1.0])] # define outputs here&lt;br /&gt;
&lt;br /&gt;
    def __call__(self):&lt;br /&gt;
        # this just passes the input color to output using map. alter lambda to&lt;br /&gt;
        # provide functionality (hint 1.0 - x for invert)&lt;br /&gt;
        self.output.Color = map(lambda x: x, self.input.Color) # do operation here&lt;br /&gt;
&lt;br /&gt;
__node__ = TemplateNode # change TemplateNode to match the name of your node&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic template - version that will appear amongst templates available at the text editor===&lt;br /&gt;
Save the script as scripttemplate_pynode.py into your Blender script directory. When in Blender, be sure to update your scripts so that Blender will find it. You can do this by opening Scripts Window and then hitting &amp;quot;Update Menus&amp;quot; in the Scripts menu. An alternative way to do this is to open User Preferences and then go to File Paths and hit the button left to folder icon just next to &amp;quot;Python Scripts:&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
After you have done either of those, the template should appear amongst the script templates in the text editor window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!BPY&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
Name: 'PyNode'&lt;br /&gt;
Blender: 246&lt;br /&gt;
Group: 'ScriptTemplate'&lt;br /&gt;
Tooltip: 'Create a new PyNode based on template'&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from Blender import Window&lt;br /&gt;
import bpy&lt;br /&gt;
&lt;br /&gt;
script_data = \&lt;br /&gt;
'''&lt;br /&gt;
# John Doe 2008&lt;br /&gt;
# State license used here and provide a link to it if you want to use one&lt;br /&gt;
from Blender import Node&lt;br /&gt;
&lt;br /&gt;
class TemplateNode(Node.Scripted): # change TemplateNode to match the name of your node&lt;br /&gt;
    def __init__(self, sockets):&lt;br /&gt;
        sockets.input = [Node.Socket('Color', val = 4*[1.0])] # define inputs here&lt;br /&gt;
        sockets.output = [Node.Socket('Color', val = 4*[1.0])] # define outputs here&lt;br /&gt;
&lt;br /&gt;
    def __call__(self):&lt;br /&gt;
        # this just passes the input color to output using map. alter lambda to&lt;br /&gt;
        # provide functionality (hint 1.0 - x for invert)&lt;br /&gt;
        self.output.Color = map(lambda x: x, self.input.Color) # do operation here&lt;br /&gt;
&lt;br /&gt;
__node__ = TemplateNode # change TemplateNode to match the name of your node&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
new_text = bpy.data.texts.new('pynode_template.py')&lt;br /&gt;
new_text.write(script_data)&lt;br /&gt;
bpy.data.texts.active = new_text&lt;br /&gt;
Window.RedrawAll()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mindrones bot</name></author>
		
	</entry>
</feed>