トップ  >  1. Blenderリリースノート翻訳  >  Blender機能別  >  Blender2.46 Python API とスクリプト
元記事:Release Notes-Notes246-Python API - BlenderWiki


Python API とスクリプト



[wiki]***Blender
-[[Blender.Get/Set に "mipmap" と "compressfile" オプションを追加。:http://www.blender.org/documentation/246PythonDoc/Blender-module.html#Get]]
-[[Blender.SaveUndoState():http://www.blender.org/documentation/246PythonDoc/Blender-module.html#SaveUndoState]]
-[[Blender.GetPaths( absolute=0 )が、その blend ファイルが使用するファイル(ライブラリ、Image、Sound、Font、Sequencer Movie など)のリストを返すように。:http://www.blender.org/documentation/246PythonDoc/Blender-module.html#GetPaths]]


***Object
-ObjectUpdate イベントと ObDataUpdate イベントの ScriptLinks。Python スクリプトはオブジェクトやデータが変更された時はいつでも実行可能になります。
-[[object.matrixParentInverse:http://www.blender.org/documentation/246PythonDoc/Object.Object-class.html#matrixParentInverse]]
-[[object.dupliFaceScale:http://www.blender.org/documentation/246PythonDoc/Object.Object-class.html#dupliFaceScale]](訳注:原文のミス?)
-[[キーフレーム挿入の種類にオブジェクトレイヤ(LAYER)を追加:http://www.blender.org/documentation/246PythonDoc/Object-module.html#IpoKeyTypes]]
-[[オブジェクトのAnim パネルの Track と Up 軸へのアクセス(読み込みのみ):http://www.blender.org/documentation/246PythonDoc/Object.Object-class.html#trackAxis]]
-[[object.getBoundBox(worldspace)にオプション引数を追加。ローカルスペース(localspace)のバウンディングボックスを取得できます。オブジェクトのワールドスペース行列が役に立たない、Dupli〜されたバウンディングボックスを取得する時に便利です。:http://www.blender.org/documentation/246PythonDoc/Object.Object-class.html#getBoundBox]]


***Mesh
-[[mesh.renderColorLayer:http://www.blender.org/documentation/246PythonDoc/Mesh.Mesh-class.html#renderColorLayer]]と、[[mesh.renderUVLayer:http://www.blender.org/documentation/246PythonDoc/Mesh.Mesh-class.html#renderUVLayer]]
-[[新しい Face のスムージング用キーワード、faces.extend([..., smooth=True]):http://www.blender.org/documentation/246PythonDoc/Mesh.MFaceSeq-class.html#extend]]
-[[キーワード引数の追加、mesh.pointInside(point, selected_only=True)。は内部/外部判定を行う際、選択された Face のみテストします。デフォルトでは無効です。:http://www.blender.org/documentation/246PythonDoc/Mesh.Mesh-class.html#pointInside]]
-[[mesh.addMultiresLevel():http://www.blender.org/documentation/246PythonDoc/Mesh.Mesh-class.html#addMultiresLevel]]
-[[mesh.getTangents():http://www.blender.org/documentation/246PythonDoc/Mesh.Mesh-class.html#getTangents]]


***Armature
-LayerMask access for [[Armatures:http://www.blender.org/documentation/246PythonDoc/Armature.Armature-class.html#layerMask]] と [[Bone:http://www.blender.org/documentation/246PythonDoc/Armature.Bone-class.html#layerMask]]、[[PoseBone:http://www.blender.org/documentation/246PythonDoc/Pose.PoseBone-class.html#layerMask]] のレイヤーマスクへのアクセス。
-[[pose_bone.poseMatrix の設定が可能に。行列を直接設定はせず、Pose Bone の Loc/Size/Rot のみ設定、処理する Armature に Constraint がない場合に、期待通りの動作をします。Copy Visual Loc/Size/Rot と同じコードを使用しています(アニメーションのベイクに便利です):http://www.blender.org/documentation/246PythonDoc/Pose.PoseBone-class.html#poseMatrix]]


***Image
-[[image.updateDisplay()。浮動小数点数画像から表示画像を更新します。:http://www.blender.org/documentation/246PythonDoc/Image.Image-class.html#updateDisplay]]
-[[getPixelHDR():http://www.blender.org/documentation/246PythonDoc/Image.Image-class.html#getPixelHDR]]と [[setPixelHDR():http://www.blender.org/documentation/246PythonDoc/Image.Image-class.html#setPixelHDR]]。HDR ピクセルへの Python アクセス。


***Material
-MTex クラスに[[fromDupli:http://www.blender.org/documentation/246PythonDoc/Texture.MTex-class.html#fromDupli]]と、[[fromOrig:http://www.blender.org/documentation/246PythonDoc/Texture.MTex-class.html#fromOrig]](Boolean型)を追加。
-[[TEXFACE_ALPHA オプションへのアクセス。:http://www.blender.org/documentation/246PythonDoc/Material-module.html#Modes]]
-[[Gloss 設定:glossMir、sampGlossMir、glossTra、sampGlossTra。:http://www.blender.org/documentation/246PythonDoc/Material.Material-class.html#glossMir]]


***NLA
-[[NLA の Mute フラグへのアクセスを追加。:http://www.blender.org/documentation/246PythonDoc/NLA-module.html#Flags]]


***Curve
-[["del curve[i]" で、Python からカーブを削除できるように。:http://www.blender.org/documentation/246PythonDoc/Curve-module.html]]
-[[CurNurb.smooth addition:http://www.blender.org/documentation/246PythonDoc/Curve.CurNurb-class.html#smooth]]
-[[SurfNurb クラスの knot ベクトルへのアクセス。:http://www.blender.org/documentation/246PythonDoc/Curve.SurfNurb-class.html#knotsU]]


***Window
-[[Window.TestBreak()。ユーザが[Esc]キーを押すと True に。:http://www.blender.org/documentation/246PythonDoc/Window-module.html#TestBreak]]
-[[Window.ViewLayers()。それぞれのビューポート用にレイヤを設定可能。:http://www.blender.org/documentation/246PythonDoc/Window-module.html#ViewLayers]]
-[[Window.GetPivot():http://www.blender.org/documentation/246PythonDoc/Window-module.html#GetPivot]]と、[[Window.SetPivot():http://www.blender.org/documentation/246PythonDoc/Window-module.html#SetPivot]]。
-[[Window.PoseMode()。PoseMode かどうかチェックします。読み込みのみ。:http://www.blender.org/documentation/246PythonDoc/Window-module.html#PoseMode]]


***Texture
-[[texture.evaluate の引数に Vector 同様、数値のタプルが使用できるように:http://www.blender.org/documentation/246PythonDoc/Texture.Texture-class.html#evaluate]]
-[[TEX_PRV_ALPHA、TEX_REPEAT_XMIR、TEX_REPEAT_YMIR が tex.flags アトリビュートに使用できるように。:http://www.blender.org/documentation/246PythonDoc/Texture-module.html#Flags]]


***Draw
-[[PupTreeMenu()。Python からツリーメニューを作ります。:http://www.blender.org/documentation/246PythonDoc/Draw-module.html#PupTreeMenu]]
-[[スクリーンフォント12(固定幅)を "normalfix" としてサポートするように。:http://www.blender.org/documentation/246PythonDoc/Draw-module.html#Text]]


***Geometry
-[[Blender.Geometry.ClosestPointOnLine(pt, vec1, vec2) → (pt, lambda):http://www.blender.org/documentation/246PythonDoc/Geometry-module.html#ClosestPointOnLine]]


***Modifier
-[[DISPLACE モディファイアへのアクセスの追加と、ARRAY 定数を Modifier のドキュメントに追加。:http://www.blender.org/documentation/246PythonDoc/Modifier-module.html]]


***Lamp
-[[lamp.falloffType が欠けていました。:http://www.blender.org/documentation/246PythonDoc/Lamp.Lamp-class.html#falloffType]]


***BGL
-[[glPushClientAttrib():http://www.blender.org/documentation/246PythonDoc/BGL-module.html#glPushClientAttrib]] と [[PopClientAttrib():http://www.blender.org/documentation/246PythonDoc/BGL-module.html#glPopClientAttrib]]


***Sys
-[[cleanpath()。./foo/../././のような不必要な物を除去します。:http://www.blender.org/documentation/246PythonDoc/Sys-module.html#cleanpath]]


***Scene

***Scene.Render
-[[ベイク機能へのアクセス、API と AutoBake用 API:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#bake]]
-Blender を分数 FPS 対応に。やっと NTSC の動作が正常になりました。NTSC は 30.0/1.001 FPS であり、これは約29.97FPS ですが、これを表現するには精度が足りず、単に frs_sec を float にするだけでは不十分です。私は別の変数、frs_sec_base を追加、FPSは [[frs_sec:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#fps]] / [[fpsBase:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#fpsBase]] のようになりました。
-OpenEXR 設定アクセス用API、[[scene.render.halfFloat:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#halfFloat]]、[[scene.render.zbuf:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#zbuf]]、[[scene.render.preview:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#preview]]
-[[scene.render.touch:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#touch]]、[[scene.render.noOverwrite:http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#noOverwrite]]
-[[scene.render.getFrameFilename():http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html#getFrameFilename]]で、レンダリングされる Image のファイル名が得られます。
-MULTILAYER Image タイプを追加。


***PyNodes
-http://wiki.blender.org/index.php/BlenderDev/PyNodes
-http://wiki.blender.org/index.php/BlenderDev/PyNodes/API
(訳注:シェーディングノードの項も参照のこと)


***PyConstraints
-(まだドキュメントがありません)



**同梱スクリプトの更新と変更
***tree wizard
tree wizard は、Curve から SubSurf されたスキンを作成します。UVも作成します(近日中には Bone も)。ユーザインターフェイスが必要です。

'Tree from curves' ツール用のユーザインターフェイスを追加。同様に、#define の Filter を Blur to Filter にリネーム。

枝に沿う Armature の自動生成。

Bone が木に影響するよう、枝がその Mesh と Armature モディファイアに適用するウェイトを持つようになりました。

枝 Bone がテクスチャを参照した Driver を使用してアニメーションできるようになり、生成後に Cloud、Noise などでアニメーション制御できます。まだアニメーションスピードと量のユーザ設定を追加する必要があります。

curve2tree - アニメーション設定 - スピードと量の Python API - texture.evaluate に Vector 同様、数値のタプルを使用できるように。

Tree 毎の設定の保存と読み込み、また、Driver によるオブジェクトの位置を使用した唯一のアニメーションを行う方法を追加。
-枝の終端をふさぐオプション(Cap)と、UV スケールオプション、自動アップデートオプションを追加。同様にバグも修正。

うまく節がつぶれるように(半径と角度の違いをチェック)、現存する Mesh を再利用する場合、そこの VertexGroup を削除するように。

Blender の Curve を枝に変換する部分を書き直し。以前は Mesh に変換し、その後、半径をどれぐらいにすべきか判明するために位置のチェックを行い、そして補間します。これはこのスクリプトの最も遅い部分であり、Mesh を毎回作成していました。

Blender の Bezier 補間関数を使用し、Blender が行っているのと同様の位置計算を行うように。

Z 軸の Drive の文法エラーを修正(タイポ)。

親のループがもう起こらないようになり、4つ以上の子のセグメントの処理を改良。時間をコンソールウィンドウに出力するように。

'Twigs(小枝)' - 枝を現存の物に追加すると、現存の枝が新しい物とブレンドされます。

スケーリング、方向のランダム度、Twig の数、Twig の再帰などのいくつかのユーザ設定。

新しい UV スケーリングオプションで、大きい/小さい枝での動作が改善されます。バウンディング Mesh 内でのみ限定的に Twig を成長させることができます。伸びた Twig のカットを行うオプション([Prune])。

子 Twig を伸ばすオプション。
-自動 Alpha ブレンド、Material Texture と UV レイヤを使用したテクスチャ画像の結合。また、ディテールオプションの追加と、ローポリの結果を簡単に得られるように。

その他の Twig オプション
-gravity (Particle のように)
-follow parent (gravity と似ていますが、親の Normal を使用します)
-それぞれの枝の Twig 数の制限
-Twig が枝上に生成される位置の範囲の制限
-枝の根元の刈り込み。大きな枝上の小さな枝の処理に適しています。

最初の Leaf(葉)サポート(現時点では本当に簡単な、制作に必要最小限なものです)。

Twig taper を bool 型から float 型に。設定読み込み時の型変換を追加。

-Fill Twigs を改良、他の枝のように、スキンを延長して結合するように。
-コピー Leaf の位置の改良 - (最終レンダリングに使用に耐える物に)

-Leaf を上向きにするか下向きにするかのオプション。
-Pitch と Roll をランダムにするオプション。
-の密集した葉の表現用に、ひとつの場所に二つの Leaf を置くように。
-Random seed エントリ。(同じ値にすることで、乱数による)結果を再現できるように。

-Fill Twig の場所を決定するウェイト配分の改良。
-Curve の方向がもう使用されなくなりました - 単にスモールエンドを終端とするだけに。

-葉を DupliFace とする最初のサポート。
-もっと均一な結果が得られる新しい Twig タイプ - "Fill Twigs" オプション


***Weightpaint Normalize
この新しいオプションは、WeightPaint を正規化するスクリプトです。
-"Armature only" - 他のものにも Weight Group(VertexGroup)を使用していた時、Armature 用の Group のみ作用させます。
-"Active only" - (OFFにすれば)すべての Weight Group を正規化することができます。
常にアクティブオブジェクトを使用します(Local View では内容がむちゃくちゃになっていました)。


***Weightpaint Invert
単に Weight を反転するスクリプトです。WeightPaint メニューから使用できます。


***DXF Importer
http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D


*** Updated FLT scripts
Blender FLT I/O スクリプトが更新され、機能が増えました。さらに、Blender 内で FLT データベースの作業をするのに便利なユーティリティスクリプト/アプレットがいくつか追加されました。
ドキュメントは以下にあります。
http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_flt
http://wiki.blender.org/index.php/Scripts/Manual/Export/openflight_flt
http://wiki.blender.org/index.php/Scripts/Manual/FLTools


***Object Timeoffset follow active
すべての選択中のオブジェクトの Timeoffset を、アクティブオブジェクトのアニメーション Path を使用して設定します。
つまり、100個のオブジェクトを、アニメーションする Empty によってアニメーションさせることができるということで、例えば、ウェーブ(Mexican wave)のような設定が簡単に行えます。


***Save RenderLayers
RenderLayer をファイルに保存するスクリプト。他の .blend ファイルから読み込むことができます。パイプライン中で設定を適用するときに便利です(と、Andy が私にいいました。)。


***blend2renderinfo
Blender で読み込むことなく、blend ファイルからシーンのリスト、開始フレーム、終了フレームをスタンドアローンで読み込みます。
シーンはレンダータグが付けられている必要があります(旧 Render daemon ボタン)。データブラウザ([Shift]+[F4])で Scene を選択して設定することもできます。
(訳注:設定方法がわかりませんでした)

このスクリプトを使用することで、Blender をロードするより非常に高速にレンダーファーム用のジョブを生成できます。

このスクリプトはコマンドラインから実行でき(.blenderscriptsbpymodules 内)、[(star,end,scene),…] と表示します。もし Import した場合、リスト[(start,end,scene),…]を返す関数 read_blend_rend_chunk(path) を持っているだけです。


***Import Lightwave Motion
LightWave のモーションをアクティブオブジェクトにインポートします。


***Milkshape 3D binary importer
milkshape3d モデルインポーター。テクスチャ付きモデルを、Material とアニメーションと一緒にインポートできます。


***Cal3d Exporter
Cal3D Exporter を削除。Soya3D が自身の物を保守しており、私も Bone の奇妙なエクスポートのバグが修正できなかったからです。


***Text Editor Templates
スクリプトのテンプレートです。
-Metaball 作成
-Camera スクリプト
-Ipo
-PyConstraint


***X3D Export
-Dupli-オブジェクトのエクスポートをサポート。
-モディファイアを Apply したオブジェクトをエクスポートするオプション。
-四角形 Face を三角形に分離してエクスポートするオプション。
[/wiki]


元記事:Release Notes-Notes246-Python API - BlenderWikiの20:08, 19 May 2008版を元にしています。
プリンタ用画面
友達に伝える
投票数:45 平均点:10.00
前
Blender2.46 ゲームエンジン
カテゴリートップ
Blender機能別
次
Blender2.46 NDOF サポート

ログイン

ユーザ名:

パスワード:



パスワード紛失

クイックリンク

2021/07/01版
●Blender.org
BlenderFoundation
- Blenderのダウンロード
- 公式チュート等
- 公式マニュアル(和訳)

●ニュース(英文)
BlenderNation

●Blenderコミュニティ
blenderartists.org

●Blender Q&A
- Blender Stack Exchange

●テストビルド
Buildbot(自動生成)


●開発関連
公式開発サイト
Blender開発blog
Blender Wiki