Rendering学習日記

日々、3DCGの世界は進歩しています。勉強して理解したことをまとめていきます。RenderMan互換レンダラーやグローバル・イルミネーション。いろんなことに好奇心を持って、面白くなる。目指せShader書き!!
ありがとうございます。

Mac OS X 10.6.6(Snow Leopard)にcgkitインストール

Mac OS Xに入っているPythonは、
Leopard → 2.5.1、
Snow Leopard → 2.5.5、2.6.1、
Lion → 2.5.5、2.6.6、2.7.1 が最初からインストールされています。

cgkitをダウンロードしインストール設定してみました。参考にしたのは下記のサイトです。
ありがとうございます。
Python cgkit 2.o on (Snow) Leopard
http://sites.google.com/site/lefranckcom/home/pythoncgkit2oonsnowleopard

■http://www.macports.org/install.phpからMacPorts-2.0.3.pkgをダウンロード
し、インストールします。

■ターミナルを開き、
$ sudo port install python26 scons boost +python26

と入力します。管理者パスワードを入れるとダウンロードがはじまります。
boost_python libraryなどコンパイルされインストールがはじまります。とても長く、しばらく時間がかかります。python27もインストールされました。

cgkitを使うためには、新たにインストールしたpython2.6を使っていきます。サポートライブラリをコンパイルするためです。以下PATHの設定を書き換えます。

$ cd ~
でホームディレクトリに行き、ls -aで.bash_profileがあるか確認します。

$ nano .bash_profile
でnanoエディタを開き
#PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"

PATH=/opt/local/bin/python2.6:$PATH
export PATH

これをなるべく上の行に書き加えます。保存して終了します。
PATHを反映させるために
$ source .bash_profile

$ echo $PATH
で書き加えたPATHが入っているか確認します。

$ python2.6
と打つとビルドした日付が出ます。
$ which python2.6
/opt/local/bin/python2.6

■Compiling the support library
cgkitを入手します。
http://sourceforge.net/projects/cgkit/files/cgkit/
cgkit-2.0.0alpha9.tar.gzをダウンロードします。
cgkit-2.0.0alpha9-py2.5-macosx10.4.dmgは使えません。

cgkit-2.0.0alpha9.tar.gzを解凍します。

$ cd cgkit-2.0.0alpha9/
$ cd supportlib/
$ cd src/
$ nano polyhedrongeom.cpp

line 401行目,
typedef GLvoid (CALLBACK *TessCallback)(...);

以下のように書き換えて保存します。
typedef GLvoid (CALLBACK *TessCallback)();

$ cd ..
一つ上に上がり、
$ nano SConstruct

SConstruct を開きline 38行目:
env.Append(CCFLAGS = ["-arch", "i386", "-arch", "ppc"])

env.Append(CCFLAGS = ["-arch", "x86_64"])
に書き換えます。64ビットでコンパイルできるようにします。

$ scons
と入力するとサポートライブラリのコンパイルがはじまります。

$ cd ..
一つ上に上がり、
$ cp config_template.cfg config.cfg
コピーをつくります。
config.cfgを開き

46行目:
BOOST_LIB = "boost_python"
のコメント#を消します。

118, 119行目を次のようにします。
INC_DIRS += ["/opt/local/include"]
LIB_DIRS += ["/opt/local/lib"]

以上を変更保存します。次にビルドします。

$ python2.6 setup.py build

続いて
$ sudo python2.6 setup.py install

以上でcgkitできあがりです。
チェックしてみましょう。
$ cd utilities/
$ python2.6 checkenv.py
-------------------------------------------------------------------
Python 2.6.7 (r267:88850, Jan 13 2012, 17:06:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
Platform: darwin
-------------------------------------------------------------------
Python version: 2.6........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0alpha9 (Jan 24 2012, 00:13)
cgkit (C++ lib)............... OK
cgkit (all)................... OK

cgkitでOKが出ていれば成功です。
ところで、上記のPyProtocols...PyOpenGL...PIL..pygame...PyODE..PySerial..はmissingになっていると思います。まだ完全にcgkitは動いてくれません。後ほどMacPortsを使ってPyProtocols以外は、インストールすることができます。

続いて複数のpythonが入っているように設定を変えます。
現在切り替えられるpythonを確認するために
$ port select --list python

とすると、
Available versions for python:
none
python25-apple
python26
python26-apple
python27

複数のpythonがでてきます。現在activeなのはありません。バージョンを切り替えるには、
$ sudo port select --set python python26

で切り替わります。
Available versions for python:
none
python25-apple
python26 (active)
python26-apple
python27


PILはいくつかのライブラリに依存しています。Python Imaging Libraryインストール
$ port search py26-pil
$ port deps py26-pil
$ sudo port install py26-pil

PyOpenGLインストール
$ port deps py26-opengl
$ sudo port install py26-opengl

PyODEインストール
$ port search py26-ode
$ port deps py26-ode
$ sudo port install py26-ode

pygameインストール
$ port search py26-game
$ port deps py26-game
$ sudo port install py26-game

PySerialインストール
$ port search py26-serial
$ port deps py26-serial
$ sudo port install py26-serial

PyProtocolsインストール
PyProtocols-0.9.3をダウンロード
http://peak.telecommunity.com/
PyProtocols-0.9.3フォルダに移動し、
$ python2.6 setup.py --without-speedups install

RenderManレンダラ
3delight-10.0.4-Darwin-Universal.pkgをインストールし、
cgkitサイトのチュートリアルから
demo1.py
demo2.py
demo3.py
を保存します。

サンプルファイルがある場所で
$ viewer.py demo1.py
で動作するか確かめます。
さらに
$ render.py -r3delight demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
3DL ERROR: Two different displays can't write to the same file (will keep 'file' and ignore 'framebuffer')
Rendering time: 0s

$ $ i-display out.tif
out.jpg
  • -
  • -

cgkit install under Debian

1. pygame install

libsdl-image1.2_1.2.10-2+b2_i386.deb
libmikmod2_3.1.11-a-6.3_i386.deb
libsmpeg0_0.4.5+cvs20030824-2.2_i386.deb
libsdl-mixer1.2_1.2.8-6.3_i386.deb
libsdl-ttf2.0-0_2.0.9-1_i386.deb
python-pygame_1.8.1release-2+b1_i386.deb


2. freeglut3-dev

xtrans-dev_1.2.5-1_all.deb
x11proto-core-dev_7.0.16-1_all.deb
x11proto-input-dev_2.0-2_all.deb
libxdmcp-dev_1.0.3-2_i386.deb

libxau-dev_1.0.6-1_i386.deb
libpthread-stubs0_0.3-2_i386.deb
libpthread-stubs0-dev_0.3-2_i386.deb
libxcb1-dev_1.6-1_i386.deb
x11proto-kb-dev_1.0.4-1_all.deb

libx11-dev_1.3.3-4_i386.deb
mesa-common-dev_7.7.1-5_i386.deb

linux-libc-dev_2.6.32-39squeeze1_i386.deb
libc-dev-bin_2.11.2-10_i386.deb
libc6-dev_2.11.2-10_i386.deb

libgl1-mesa-dev_7.7.1-5_i386.deb

libglu1-mesa-dev_7.7.1-5_i386.deb
libice-dev_1.0.6-2_i386.deb
libsm-dev_1.1.1-1_i386.deb
libxt-dev_1.0.7-1_i386.deb
x11proto-xext-dev_7.1.1-2_all.deb
libxext-dev_1.1.2-1_i386.deb

freeglut3-dev_2.6.0-1_i386.deb


3. python-pyode

libode1_0.11.1-3_i386.deb
python-pyode_1.2.0-4+cvs20090320+b1_i386.deb


4. scons_2.0.0-1_all.deb


5.Synaptic package install

select libstdc++6.4.4-dev
binutils
g++-4.4
gcc-4.4
libstdc++6-4.4-dev

6. boost
libboost1.42-dev_1.42.0-4_i386.deb

zlib1g-dev_1.2.3.4.dfsg-3_i386.deb
libssl0.9.8_0.9.8o-4squeeze7_i386.deb
libssl-dev_0.9.8o-4squeeze7_i386.deb
python2.6-dev_2.6.6-8+b1_i386.deb


libboost-python1.42.0_1.42.0-4_i386.deb
gcc_4.4.5-1_i386.deb
g++_4.4.5-1_i386.deb
gccxml_0.9.0+cvs20100501-2_i386.deb
python-dev_2.6.6-3+squeeze6_all.deb
libboost-python1.42-dev_1.42.0-4_i386.deb


7. python-imaging_1.1.7-2_i386.deb

8. pyserial-2.6.tar.gz

9. PyProtocols-0.9.3.zip

10. cgkit
  • -
  • -

cgkit works under CentOS6.2 on virtualbox

Hello,
I installed cgkit under CentOS6.2 on virtualbox
2012-02-12 03:54:34

# uname -a
Linux 2.6.32-220.4.1.el6.i686

following are:
1.boost
Installed: boost-devel-1.41.0-11.el6_1.2.i686

2.gcc
# yum install gcc

Installed: kernel-headers-2.6.32-220.4.1.el6.i686
Updated: glibc-common-2.12-1.47.el6_2.5.i686
Updated: glibc-2.12-1.47.el6_2.5.i686
Installed: glibc-headers-2.12-1.47.el6_2.5.i686
Installed: glibc-devel-2.12-1.47.el6_2.5.i686
Installed: mpfr-2.4.1-6.el6.i686
Installed: cpp-4.4.6-3.el6.i686
Installed: ppl-0.10.2-11.el6.i686
Installed: cloog-ppl-0.15.7-1.2.el6.i686
Installed: gcc-4.4.6-3.el6.i686

3.freeglut
# yum install freeglut3
Installed: freeglut-2.6.0-1.el6.i686

4.cmake
Installed: cmake-2.6.4-5.el6.i686

5.# yum --enablerepo=epel install fltk
Installed: fltk-1.1.10-1.el6.i686

6.# yum --enablerepo=epel install aqsis
Installed: ilmbase-1.0.1-6.1.el6.i686
Installed: OpenEXR-libs-1.6.1-8.1.el6.i686
Installed: tinyxml-2.6.1-1.el6.i686
Installed: aqsis-libs-1.6.0-3.el6.i686
Installed: aqsis-core-1.6.0-3.el6.i686
Installed: aqsis-data-1.6.0-3.el6.noarch
Installed: aqsis-1.6.0-3.el6.i686


7.freeglut-devel
Installed: xorg-x11-proto-devel-7.6-13.el6.noarch
Installed: libXau-devel-1.0.5-1.el6.i686
Installed: libxcb-devel-1.5-1.el6.i686
Installed: libXdmcp-devel-1.0.3-1.el6.i686
Installed: libX11-devel-1.3-2.el6.i686
Installed: libXext-devel-1.1-3.el6.i686
Installed: libXfixes-devel-4.0.4-1.el6.i686
Installed: libXdamage-devel-1.1.2-1.el6.i686
Installed: libXxf86vm-devel-1.1.0-1.el6.i686
Installed: libdrm-devel-2.4.25-2.el6.i686
Installed: mesa-libGL-devel-7.11-3.el6.i686
Installed: mesa-libGLU-devel-7.11-3.el6.i686
Installed: freeglut-devel-2.6.0-1.el6.i686

8.
Installed: python-setuptools-0.6.10-3.el6.noarch
Installed: libgfortran-4.4.6-3.el6.i686
Installed: python-nose-0.10.4-3.1.el6.noarch
Installed: atlas-3.8.4-1.el6.i686
Installed: numpy-1.3.0-6.2.el6.i686
Installed: PyOpenGL-3.0.0-2.1.el6.noarch

9.
Installed: python-imaging-1.1.6-19.el6.i686

Download:Pyserials
http://pypi.python.org/pypi/pyserial
pyserial-2.6.tar.gz
# python setup.py install

10.
Installed: libstdc++-devel-4.4.6-3.el6.i686
Installed: compat-libstdc++-33-3.2.3-69.el6.i686

11.pygame
Installed: portmidi-217-3.el6.i686
Installed: SDL_image-1.2.10-1.el6.rf.i686
Installed: SDL_ttf-2.0.9-6.el6.i686
Installed: SDL_mixer-1.2.11-3.el6.i686
Installed: pygame-1.9.1-4.el6.i686

12.
Installed: gcc-c++-4.4.6-3.el6.i686

13.
Installed: ode-0.11.1-2.el6.i686
Installed: ode-devel-0.11.1-2.el6.i686
Installed: compat-libstdc++-296-2.96-144.el6.i686
Installed: Pyrex-0.9.8

14.
Installed: python-devel-2.6.6-29.el6.i686
Download PyODE
# python setup.py build
# python setup.py install

15.
Installed: scons-1.2.0-2.el6.rfx.noarch

16.
Installed: autoconf-2.63-5.1.el6.noarch
Installed: automake-1.11.1-1.2.el6.noarch

17.
Download PyProtocols
# python setup.py --without-speedups install

18.
Download cgkit-2.0.0alpha9.tar.gz
# cd cgkit-2.0.0alpha9/
# cd supportlib/
# scons
# cd ..
# python setup.py build
# python setup.py install
# cd utilities/
# python checkenv.py
----------------------------------------------------------------------
Python 2.6.6 (r266:84292, Dec 7 2011, 20:38:36)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.6........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0alpha9 (Feb 10 2012, 20:34)
cgkit (C++ lib)............... OK
cgkit (all)................... OK

render.py -r3delight simplescene.py
OK.

viewer.py -N softimage demo1.py
OK.

but
Navigation mode (Default: Maya) does not work.
As long as it works, I wouldn't worry about it.
CentOSのウィンドウ設定でAltキーをWindows keyに変更したらできました。

Thank you.
Yuichirou Yokomakura
  • -
  • -
<< 4/8 >>