<< Manjaro Linux18 python cgkit install 戻る Sitex Air Renderer and Python cgkit >>

Installed python cgkit and sitex air renderer under Windows10

最後のPython2.7の64bit版をwindows10にインストールしました。
python cgkitをインストールし、旧RenderMan互換レンダラーであるsitex air rendererを利用することにしました。

■手順
以下からいくつかのライブラリをダウンロードします。

http://www.lfd.uci.edu/~gohlke/pythonlibs/


■pipの設定
>python -m pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
|################################| 1.4MB 591kB/s
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-20.0.2

■pygameインストール
>pip install pygame-1.9.6-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\pygame-1.9.6-cp27-cp27m-win_amd64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.6

■odeインストール
>pip install ode-0.15.2-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\ode-0.15.2-cp27-cp27m-win_amd64.whl
Installing collected packages: ode
Successfully installed ode-0.15.2

■PyOpenGLインストール
>pip install PyOpenGL-3.1.5-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\pyopengl-3.1.5-cp27-cp27m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.5

■cgkitインストール
>pip install cgkit-2.0.0-cp27-none-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\cgkit-2.0.0-cp27-none-win_amd64.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

■インストールしたものの内容確認
C:\Users\yokamak\Downloads>pip freeze
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
cgkit==2.0.0
ode==0.15.2
pygame==1.9.6
PyOpenGL==3.1.5

■PILのダミーをインストール、自動的にPillowがインストール
>pip install "PIL-2.0+dummy-py2.py3-none-any.whl"
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\pil-2.0+dummy-py2.py3-none-any.whl
Collecting Pillow>=2.0
Downloading Pillow-6.2.2-cp27-cp27m-win_amd64.whl (1.9 MB)
|################################| 1.9 MB 3.0 MB/s
Installing collected packages: Pillow, PIL
Successfully installed PIL-2.0+dummy Pillow-6.2.2

■python cgkitの動作確認。

\cgkit>viewer.py demo1.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

\cgkit>viewer.py demo2.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

\cgkit>viewer.py demo3.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html


■テクスチャを貼るシーンのロード失敗。Pillowは対応しない。

\cgkit>viewer.py simplescene.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Texname: 1
Loading "uvmap.png"...
Traceback (most recent call last):
File "C:\Python27\Scripts\viewer.py", line 699, in
viewer.run()
File "C:\Python27\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python27\Scripts\viewer.py", line 384, in action
self.draw(self.cam, self.width, self.height)
File "C:\Python27\Scripts\viewer.py", line 676, in draw
renderer.paint(root)
File "C:\Python27\lib\site-packages\cgkit\glmaterial.py", line 105, in loadTexData
self._passPILImage(img)
File "C:\Python27\lib\site-packages\cgkit\glmaterial.py", line 141, in _passPILImage
self.texData(w, h, format, GL_UNSIGNED_BYTE, img.tostring())
File "C:\Python27\lib\site-packages\PIL\Image.py", line 779, in tostring
"tostring() has been removed. Please call tobytes() instead."
NotImplementedError: tostring() has been removed. Please call tobytes() instead.

■レンダリングの確認、scitex air rendererを使用する。

\cgkit>render.py -rair demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 2s

\cgkit>render.py -rair demo2.py
Exporting main.rib...
1 passes...
Compiling shaders...
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 1s

■PILの削除
\cgkit>pip uninstall PIL
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: PIL 2.0+dummy
Uninstalling PIL-2.0+dummy:
Would remove:
c:\python27\lib\site-packages\pil-2.0+dummy.dist-info\*
Proceed (y/n)? y
Successfully uninstalled PIL-2.0+dummy

■内容確認
\cgkit>pip list
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
---------- -------
cgkit 2.0.0
ode 0.15.2
Pillow 6.2.2
pip 20.0.2
pygame 1.9.6
PyOpenGL 3.1.5
setuptools 41.2.0

■Pillowの削除
\cgkit>pip uninstall Pillow
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: Pillow 6.2.2
Uninstalling Pillow-6.2.2:
Would remove:
c:\python27\lib\site-packages\pil\*
c:\python27\lib\site-packages\pillow-6.2.2.dist-info\*
Proceed (y/n)? y
Successfully uninstalled Pillow-6.2.2

■内容確認
\cgkit>pip list
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
---------- -------
cgkit 2.0.0
ode 0.15.2
pip 20.0.2
pygame 1.9.6
PyOpenGL 3.1.5
setuptools 41.2.0

■PILのインストール
最後にpython cgkitは、pillowではなくてPILでないとテクスチャがはりつけられないので、Windows用のbinary installした。
thank you. ありがとうございます。

PIL-1.1.7.win-amd64-py2.7.exe

■Windows Compiled Libraries
以下からダウンロード

https://github.com/lightkeeper/lswindows-lib/blob/master/amd64/python/PIL-1.1.7.win-amd64-py2.7.exe?raw=true

sitex air rendererのダウンロード


http://www.sitexgraphics.com/html/download.html

python cgkitのサンプル


cgkitサイトのtutorialからdemoファイルを入手します。
http://cgkit.sourceforge.net/tutorials/demo1.html
http://cgkit.sourceforge.net/tutorials/demo2.html
http://cgkit.sourceforge.net/tutorials/demo3.html


コマンドプロンプトから
 > viewer.py demo3.py

マウス alt+左ドラッグでカメラ目線。

sitex air rendererでレンダリングの確認
 > render.py -rair demo3.py


以下は
http://cgkit.sourceforge.net/tutorials/renderman.html
 > render.py -rair simplescene.py

cgkiA.jpg
ありがとうございます。
  • -
  • -

<< Manjaro Linux18 python cgkit install 戻る Sitex Air Renderer and Python cgkit >>