﻿<?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=%E5%88%A9%E7%94%A8%E8%80%85%3AQuorn%2FSummerOfCode2008</id>
	<title>利用者:Quorn/SummerOfCode2008 - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AQuorn%2FSummerOfCode2008"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Quorn/SummerOfCode2008&amp;action=history"/>
	<updated>2026-07-10T20:29:23Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Quorn/SummerOfCode2008&amp;diff=59286&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Quorn/SummerOfCode2008&amp;diff=59286&amp;oldid=prev"/>
		<updated>2018-06-28T17:54:29Z</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=%E5%88%A9%E7%94%A8%E8%80%85:Quorn/SummerOfCode2008&amp;diff=59285&amp;oldid=prev</id>
		<title>wiki&gt;Mindrones bot: Robot: Changing template: K</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Quorn/SummerOfCode2008&amp;diff=59285&amp;oldid=prev"/>
		<updated>2010-04-12T18:28:15Z</updated>

		<summary type="html">&lt;p&gt;Robot: Changing template: K&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Improving Python Editing In Blender==&lt;br /&gt;
This project enables users to develop Python scripts with greater ease by including a number of new features to the text editor and improving upon the existing functionality.&lt;br /&gt;
&lt;br /&gt;
For information on the changes made to Blender and the way it fits in with current development see the [http://docs.google.com/Doc?id=d5scbjf_12ffjnqqgn Integration Document]&lt;br /&gt;
&lt;br /&gt;
Or for information on using the new system, see the [[User:Quorn/SummerOfCode2008/UserManual|User Manual]]&lt;br /&gt;
&lt;br /&gt;
===Current Status===&lt;br /&gt;
&amp;lt;div class=&amp;quot;floatright&amp;quot;&amp;gt;&amp;lt;vimeo&amp;gt;1376152&amp;lt;/vimeo&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;floatright&amp;quot;&amp;gt;&amp;lt;vimeo&amp;gt;1478608&amp;lt;/vimeo&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key aspect of this project has been the text plug-in system. This system allows Python scripts to be created that interact directly with the user, and the text on which the user is working. For information on how to write a text plug-in, see the section on [[User:Quorn/SummerOfCode2008#Writing a Text Plug-in|Writing a Text Plug-in]] below.&lt;br /&gt;
&lt;br /&gt;
These videos demonstrate the features introduced by this project. For a more complete list see below.&lt;br /&gt;
&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Features Completed===&lt;br /&gt;
The following list outlines the features brought to Blender by this project:&lt;br /&gt;
* Code/member suggestion and completion ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15583 done]''']&lt;br /&gt;
* Scrollable documentation access panel ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15635 done]''']&lt;br /&gt;
* Whole word operations ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15127 done]''']&lt;br /&gt;
* Insert/overwrite support ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15115 done]''']&lt;br /&gt;
* Header lists active file (or &amp;quot;Internal&amp;quot;) and modified status (*) ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15148 done]''']&lt;br /&gt;
* External modifications are checked for and reported with options ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15364 done]''']&lt;br /&gt;
* Word wrap&lt;br /&gt;
&lt;br /&gt;
It will also fix the following issues:&lt;br /&gt;
* Library linked Text can be edited ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15162 fixed]''']&lt;br /&gt;
* Backspace at top of file inserted blank line on undo ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15119 fixed]''']&lt;br /&gt;
&lt;br /&gt;
====Additional====&lt;br /&gt;
Additional features that are being considered or would be good extensions to the project:&lt;br /&gt;
* Better search: all text search, find and replace ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15721 done]''']&lt;br /&gt;
* Interaction between Blender clipboard and text clipboard ['''[https://projects.blender.org/tracker/index.php?func=detail&amp;amp;aid=17370&amp;amp;group_id=9&amp;amp;atid=127 done]''']&lt;br /&gt;
* Additional line and positional markers, which would then allow... ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15960 done]''']&lt;br /&gt;
* Code templates and snippets&amp;lt;sup&amp;gt;[[User:Quorn/SummerOfCode2008#References|1]]&amp;lt;/sup&amp;gt; ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15982 done]''']&lt;br /&gt;
* Mindrones' Wishlist&amp;lt;sup&amp;gt;[[User:Quorn/SummerOfCode2008#References|2]]&amp;lt;/sup&amp;gt;&lt;br /&gt;
* Better support for other languages&lt;br /&gt;
* Script output redirect&lt;br /&gt;
&lt;br /&gt;
Other issues found:&lt;br /&gt;
* Redo fails when re-deleting backward-selected text ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15713 fixed]''']&lt;br /&gt;
* Pressing up at the top or down at the bottom breaks undo ['''[http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;amp;root=bf-blender&amp;amp;revision=15789 fixed]''']&lt;br /&gt;
&lt;br /&gt;
===Feature Descriptions===&lt;br /&gt;
====Code Completion====&lt;br /&gt;
When editing Python scripts it is often desirable to have a list of functions and variables defined in the current script. It is also useful to have the ability to list the various functions and fields of a given object.&lt;br /&gt;
&lt;br /&gt;
The code completion section of this project brings both of these to the user and provides a platform for further completion methods (such as snippets or tags) to be implemented.&lt;br /&gt;
&lt;br /&gt;
The actual ''completion'' comes from the ability to type only a few (if any) of the characters of the method or field before invoking the suggestions list. For template-like completion the system makes it very easy to add. A script can be written with the shortcut {{Shortcut|Tab}} that strips out at the word preceding the cursor, looks it up in some template dict and &amp;lt;code&amp;gt;insert()&amp;lt;/code&amp;gt;s the template into the code positioning the cursor in the right place with &amp;lt;code&amp;gt;setCursorPos()&amp;lt;/code&amp;gt;. If time allows I will produce such a script and a tutorial on its creation at the end of the project.&lt;br /&gt;
&lt;br /&gt;
To invoke completion simply enable syntax highlighting and press {{shortcut|ctrl|Space}}. This will list all modules, functions and variables available or defined in the script. Additional scripts work to complete import statements:&lt;br /&gt;
&amp;lt;pre&amp;gt;import |&amp;lt;/pre&amp;gt;&lt;br /&gt;
...and member fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;import Blender&lt;br /&gt;
Blender.|&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; marks the cursor position. The last period or space typed will invoke these context sensitive scripts. {{shortcut|ctrl|Space}} may also be used here.&lt;br /&gt;
&lt;br /&gt;
====Documentation Listings====&lt;br /&gt;
On similar lines to code completion a quick view of the documentation for an object is displayable. This aims to reduce the need for using external documentation by bringing it into the interface.&lt;br /&gt;
&lt;br /&gt;
Currently, whilst inside a function:&lt;br /&gt;
&amp;lt;pre&amp;gt;print somefunc(somevar, | )&amp;lt;/pre&amp;gt;&lt;br /&gt;
Pressing {{shortcut|ctrl|I}} will list the &amp;lt;code&amp;gt;somefunc&amp;lt;/code&amp;gt; function's documentation text. If the cursor is not inside a function's parentheses it will attempt to display the documentation string for the name preceding it:&lt;br /&gt;
&amp;lt;pre&amp;gt;import Blender|&amp;lt;/pre&amp;gt;&lt;br /&gt;
will display the text &amp;quot;The main Blender module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Editing Methods====&lt;br /&gt;
Editors typically have a set of operations that users have come to expect yet Blender lacked a number of these.&lt;br /&gt;
&lt;br /&gt;
Text overwrite support. Before this project you could only insert text and the {{Shortcut|Ins}} key had little use. Now the {{Shortcut|Ins}} toggles insert/overwrite modes and changes the cursor to reflect this.&lt;br /&gt;
&lt;br /&gt;
Whole word operations (implemented in some editors as {{shortcut|ctrl|Left}}, {{shortcut|ctrl|Del}}, {{shortcut|ctrl|Backspace}}, etc.) have been added. Unfortunately, {{shortcut|ctrl|Left/Right}} are reserved for screen switching so {{Shortcut|Alt}} equivalents have been substituted where appropriate:&lt;br /&gt;
{| border=1&lt;br /&gt;
|{{shortcut|alt|Left/Right}}&lt;br /&gt;
| Moves the cursor left/right by one word or group of symbols.&lt;br /&gt;
|-&lt;br /&gt;
|{{shortcut|ctrl|Backspace/Del}} &amp;lt;br&amp;gt; {{shortcut|alt|Backspace/Del}}&lt;br /&gt;
| Deletes the word to the left/right of the cursor.&lt;br /&gt;
|}&lt;br /&gt;
Word wrap is another missing feature and is very useful for writing text that is not part of a script. Word wrap will have a toggle button associated with it but is not yet implemented.&lt;br /&gt;
&lt;br /&gt;
===Writing a Text Plug-in===&lt;br /&gt;
To write your own text plug-in take a look at the template under '''File &amp;amp;rarr; Script&amp;amp;nbsp;Templates &amp;amp;rarr; Text&amp;amp;nbsp;Plugin'''. The BPy module, together with the new Text object functions allow a variety of useful tools&lt;br /&gt;
to be created.&lt;br /&gt;
&lt;br /&gt;
====The BPyTextPlugin Module====&lt;br /&gt;
The central component of many text plug-ins is the python module BPyTextPlugin. This module provides tools for parsing and obtaining useful information about a given Text object. Here is a short description of how it works and the interface for using it in your own scripts.&lt;br /&gt;
&lt;br /&gt;
The method of most use is &amp;lt;code&amp;gt;get_cached_descriptor(txtobj)&amp;lt;/code&amp;gt; which returns an instance of &amp;lt;code&amp;gt;ScriptDesc&amp;lt;/code&amp;gt; when passed a Blender Text object. If the text has not been previously parsed or for whatever reason, it is decided to reparse the text, &amp;lt;code&amp;gt;parse_text(txtobj)&amp;lt;/code&amp;gt; is called. This method can also be used to force a re-parse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;import BPyTextPlugin, bpy&lt;br /&gt;
&lt;br /&gt;
txt  = bpy.data.texts.active&lt;br /&gt;
desc = BPyTextPlugin.get_cached_descriptor(txt)&lt;br /&gt;
&lt;br /&gt;
BPyTextPlugin.print_cache_for(txt)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The best way to understand the &amp;lt;code&amp;gt;ScriptDesc&amp;lt;/code&amp;gt; instance is to look at the BPyTextPlugin module itself. Its &amp;lt;code&amp;gt;vars&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;defs&amp;lt;/code&amp;gt; fields provide lists of &amp;lt;code&amp;gt;VarDesc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FuncDesc&amp;lt;/code&amp;gt; instances which further describe the text. The &amp;lt;code&amp;gt;classes&amp;lt;/code&amp;gt; field provides access to classes with their own &amp;lt;code&amp;gt;vars&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;defs&amp;lt;/code&amp;gt; lists.&lt;br /&gt;
&lt;br /&gt;
Each descriptor has a &amp;lt;code&amp;gt;lineno&amp;lt;/code&amp;gt; field for accessing the number of the line on which it is first defined, and a &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; field for obtaining the symbol name.&lt;br /&gt;
&lt;br /&gt;
====Changes To The Text Object====&lt;br /&gt;
Once a script has obtained the information it requires it can feed this information to the user by two new methods:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.showDoc(doc)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Displays word-wrapped documentation in an easily dismissable panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.suggest(list, prefix)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Displays suggestions list limited to show items with the specified prefix.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It may also create markers (see below) by calling&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.markSelection(group, (r,g,b), flags)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Marks the current selection with the specified group, colour and behaviour flags. Use &amp;lt;code&amp;gt;Text.TMARK_EDITALL&amp;lt;/code&amp;gt; to indicate that all markers of the same group should be edited together*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sub&amp;gt;* Markers with this flag must be of the same length and mark equal text&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example using the suggestion and documentation tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;import bpy&lt;br /&gt;
from BPyTextPlugin import suggest_cmp&lt;br /&gt;
&lt;br /&gt;
txt = bpy.data.texts.active&lt;br /&gt;
sugs = [('suggest_me', 'v'),  # v for variable&lt;br /&gt;
        ('suggest_this', 'f') # f for function&lt;br /&gt;
       ]&lt;br /&gt;
sugs.sort(cmp=suggest_cmp)&lt;br /&gt;
&lt;br /&gt;
txt.showDocs('Some kind of documentation string, automatically word-wrapped')&lt;br /&gt;
txt.suggest(sugs, 'suggest_')&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' It is no longer necessary to sort the suggestions list but it is still recommended. Use &amp;lt;code&amp;gt;sort(cmp=BPyTextPlugin.suggest_cmp)&amp;lt;/code&amp;gt; for sorting.&lt;br /&gt;
&lt;br /&gt;
Other additions to the Blender Text object (&amp;lt;code&amp;gt;txt&amp;lt;/code&amp;gt;):&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;row, col = txt.getCursorPos()&amp;lt;/code&amp;gt;&lt;br /&gt;
| Returns the cursor position (row, col). Note that line numbers are usually 1-based in python, whereas row is 0-based here.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.setCursorPos(row, col)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Sets the position of the cursor in the Text object (or as close as possible). Selections are cleared.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;row, col = txt.getSelectPos()&amp;lt;/code&amp;gt;&lt;br /&gt;
| Returns the selection cursor position (row, col). Note that line numbers are usually 1-based in python, whereas row is 0-based here.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.setSelectPos(row, col)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Sets the position of the selection cursor in the Text object (or as close as possible). Selections are extended to this point, use &amp;lt;code&amp;gt;setCursorPos&amp;lt;/code&amp;gt; first to base the selection.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.insert(string)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Inserts &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; at the current cursor position.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.readline()&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reads a line from the Text object in accordance with other readline methods.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;txt.reset()&amp;lt;/code&amp;gt;&lt;br /&gt;
| Resets the IO pointer to the beginning (for reading).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
With these tools, many plug-ins can be produced, from class browsers to template completion scripts.&lt;br /&gt;
&lt;br /&gt;
===Markers===&lt;br /&gt;
Markers provide a neat way to jump around text and edit repeated portions in one go. They allow templates to be constructed where certain bits must be filled in and expand on the find and replace options.&lt;br /&gt;
&lt;br /&gt;
To see markers in action see the video above or take a look at my template script:&lt;br /&gt;
&lt;br /&gt;
https://svn.blender.org/svnroot/bf-blender/branches/soc-2008-quorn/release/scripts/textplugin_templates.py&lt;br /&gt;
&lt;br /&gt;
The template syntax used in this script is based on GEdit's snippets&amp;lt;sup&amp;gt;[[User:Quorn/SummerOfCode2008#References|1]]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Schedule===&lt;br /&gt;
During the first week, I shall learn as much as possible about the current implementation and outline the possibilities. Some of the simpler features and fixes may be carried out here. The remainder of the time will be split as follows:&lt;br /&gt;
&lt;br /&gt;
Stage 1: Implement the back end functions for code completion, documentation and other features. Output is generally directed at the console at this stage.&lt;br /&gt;
&lt;br /&gt;
Stage 2: Create UI elements for displaying the requested information. Output is fed to these on request.&lt;br /&gt;
&lt;br /&gt;
Stage 3: Implement advanced UI features and interaction (scrollable documentation panel, member selection). Also allow the user to enable/disable these features, possibly adding options to User Preferences although this should be limited.&lt;br /&gt;
&lt;br /&gt;
Stage 4: Seemless integration: enabling context sensitive pop-up without specific user request (eg. when the user types a . after a valid variable or pressing tab for snippet completion).&lt;br /&gt;
&lt;br /&gt;
Stage 5: Final testing, debugging and tidy-up. Optimizing the code for best possible performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On completion of the project, changes merged with the trunk will be documented for the general public. The wiki page at [[Manual/Python_Scripting#The_Text_Editor]] will be updated.&lt;br /&gt;
&lt;br /&gt;
===About Me===&lt;br /&gt;
I am a 21 year old Mathematics student who has just finished his final year. I am about to embark on a Masters degree in Computer Animation. I have been developing software since an early age and have experience in many languages including Pascal, Java, C, C++ and Python. I have worked on the development of an open source renderfarm for Blender&amp;lt;sup&amp;gt;[[User:Quorn/SummerOfCode2008#References|3]]&amp;lt;/sup&amp;gt; and make use of many open source tools in my daily life.&lt;br /&gt;
&lt;br /&gt;
I love the idea of making something useful for all and hope that this project will do just that.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
# [http://live.gnome.org/Gedit/Plugins/Snippets GEdit Snippets]&lt;br /&gt;
# [http://blender.mindrones.com/wishlist/text-editor Mindrones' Wishlist]&lt;br /&gt;
# [http://netblend.sourceforge.net Distriblend]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mindrones bot</name></author>
		
	</entry>
</feed>