﻿<?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%2FAPI%2FSceneRefactor</id>
	<title>Dev:2.4/Source/Python/API/SceneRefactor - 版の履歴</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%2FAPI%2FSceneRefactor"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/API/SceneRefactor&amp;action=history"/>
	<updated>2026-06-02T04:04:16Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/API/SceneRefactor&amp;diff=51636&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/API/SceneRefactor&amp;diff=51636&amp;oldid=prev"/>
		<updated>2018-06-28T17:49:50Z</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:49時点における版&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/API/SceneRefactor&amp;diff=51635&amp;oldid=prev</id>
		<title>2010年3月31日 (水) 21:47にwiki&gt;Terrywallworkによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Source/Python/API/SceneRefactor&amp;diff=51635&amp;oldid=prev"/>
		<updated>2010-03-31T21:47:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Scene Refactor Proposal==&lt;br /&gt;
&lt;br /&gt;
This page proposes additions to the existing BPY API, as discussed by Willain and Campbell (31/08/2006)&lt;br /&gt;
Variable names may change, existing functionality may eventually be depricated (after 2.43 release) and only these functions supported. - for now we will not break compatibility.&lt;br /&gt;
&lt;br /&gt;
===The Super Iterator===&lt;br /&gt;
This came up when dealing with objects and listbases.&lt;br /&gt;
scn.getChildren() scn.Link() and scn.Unlink() is not an ideal way to deal with objects.&lt;br /&gt;
A thin wrapper for listbases is very efficient and fits nicely into the python API as a set() like pyType.&lt;br /&gt;
&lt;br /&gt;
a new iterator has been added to the scene called objects.&lt;br /&gt;
This allows you do iterate through the scenes objects and has functions for adding and removing.&lt;br /&gt;
&lt;br /&gt;
Current functionality&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  for ob in scn.objects: print ob.name&lt;br /&gt;
  scn.objects.add(my_object) # Add an existing object, like scn.link()&lt;br /&gt;
  scn.objects.remove(my_object) # Remove an existing object, like scn.Unlink()&lt;br /&gt;
  ob= scn.objects.new(obdata) # make a new object from obdata, replaces the existing 2-3 step method and avoids objects having no data.&lt;br /&gt;
  ob= scn.objects.new(Mesh.Primitives.Cube(2.0))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Possible functionaly&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  ob= scn.objects.active #get the active object, like ob= scn.getActiveObject()&lt;br /&gt;
  ob= scn.objects['MyObject'] # get an object from the scene by name, must not be confused with Object.Get('MyObject')&lt;br /&gt;
  scn.objects.remove('myObject') # remove the object by name rather then getting the obdata first.&lt;br /&gt;
  scn.objects.extend([ob1, ob2, ob3]) # add objects at once.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The advantage of this is that it separates all objects into a part of scene and makes the scenes functions less polluted.&lt;br /&gt;
&lt;br /&gt;
Sub iterators&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  scn.objects.selected # iterator that iterates over selected objects, inherits most functionality from scn.objects&lt;br /&gt;
  scn.objects.context # iterator that iterates over visible selected objects.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other Iterators====&lt;br /&gt;
2 new iterator that will be added&lt;br /&gt;
* Blender.scenes # will be &amp;quot;scenes&amp;quot; where &amp;quot;from Blender import *&amp;quot; is used.&lt;br /&gt;
* scn.scriptlinks &lt;br /&gt;
&lt;br /&gt;
Proposed functionality&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  active= Blender.scenes.active # consistent with scns.objects.active&lt;br /&gt;
  for scn in scenes: print scn.name&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other iterators exist- group.objects, object.modifiers, mesh.verts, - we will try and make these iterators be consistent where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More could be added but for now this is what we will add in the short term.&lt;br /&gt;
&lt;br /&gt;
===Data Access===&lt;br /&gt;
A problem with the existing API is that data access is mixed in.&lt;br /&gt;
A new module will be added - name is undecieded... but for now we'll call it &amp;quot;Data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This would eventuallly replace the Get() functions &lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  obs= Objects.Get()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would be &lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  obs= Data.objects&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we would have access to .meshes, .worlds etc,&lt;br /&gt;
These would be thin wrappers around G.main listbases.&lt;br /&gt;
&lt;br /&gt;
Eventually .add() .remove() etc could be added also where applicable.&lt;br /&gt;
&lt;br /&gt;
It may be that this is added as a part of Blender.Library&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Terrywallwork</name></author>
		
	</entry>
</feed>