投稿

ラベル(module)が付いた投稿を表示しています

Compile Blender 2.67b Module for python3.

イメージ
I succeeded in compile of Blender2.67b as a python module on the ubuntu13.04.  The python3 of Ubuntu13.04 is Python3.3 base, it is very congenial. It is also the biggest reason to not use Ubuntu 12.4LTS and Debian 7;-) Results: Imports: >>> import bpy >>> import mathutils >>> import bmesh >>> import bpy_extras.io_utils >>> print(bpy) <module 'bpy' from '/usr/lib/python3.3/dist-packages/2.67/scripts/modules/bpy/__init__.py'> >>> print(mathutils) <module 'mathutils'> >>> print(bmesh) <module 'bmesh'> >>> print(bpy_extras) <module 'bpy_extras' from '/usr/lib/python3.3/dist-packages/2.67/scripts/modules/bpy_extras/__init__.py'> >>>  For PyDev Debugger/ Eclipse Append your code below for example. if __name__ == '__main__':   # Convert axis of Y-forward and Z-up(Blender) to -Z-forward and Y-...

Blender 2.65aをコンパイルしてpython module版を作成

イメージ
(Updete 2013-3-27:Ver 2.66a同じようにコンパイル成功、出力先フォルダ名がbuildからbuild_linuxへ変更。 blendファイルを保存するAPI,  bpy.ops.wm.save_mainfile()のcrashは修正された。 ) (Updete 2013-6-4:Ver 2.67a/Ubuntu13.04同じようにコンパイル成功 ) Blenderのpluginを本格的に開発しようとすればBlenderのpython moduleが必要と感じるはずだ。理由はデバックやEditor(IDE)が便利になるからだ。以下はその情報と注意を記した。 (手軽にBreakPointをしたい場合は http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Development/BreakPoint がいいが、さらに素早く詳細に調べる場合はbpy moduleが必須である) 以下のサイトの手順が成功した。 他のubuntu wikiなどは古く、手順も複雑でさらにコンパイルに失敗(ボクの場合)した。 コンパイル: http://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule リンク先の手順はUbuntu repositryからpython3.3のdevパッケージがインストールされるので、python3.3はソースをダウンロードしてコンパイルする手間は不要。それをした場合は最後の最後にコンフリクトをおこしてコンパイル(というかLinker)が失敗になる。(e.g. relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC) すでに自分でコンパイルしたpythonは/usr/localから地道に手作業で消さなければならない(python3.3のソースにはmake uninstallなどの自動アンインストールは現在無いからだ) 参考までに以下のフォルダー内にインストールされているが、ここを消...