Rendering学習日記

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

64bit Windows10 install

とりいそぎ、メモ:
ありがとうございます。

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Downloads>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z


C:\Users\Downloads>pip install Pillow-3.4.2-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pillow-3.4.2-cp27-cp27m-win_amd64.whl
Installing collected packages: Pillow
Successfully installed Pillow-3.4.2
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\Downloads>python -m pip install --upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1

C:\Users\Downloads>pip freeze
Pillow==3.4.2

C:\Users\Downloads>pip install pygame-1.9.2b1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pygame-1.9.2b1-cp27-cp27m-win_amd64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.2b1

C:\Users\sensei\Downloads>pip freeze
Pillow==3.4.2
pygame==1.9.2b1

C:\Users\Downloads>pip install PyOpenGL-3.1.1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pyopengl-3.1.1-cp27-cp27m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.1

C:\Users\Downloads>pip install ode-0.13.1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\ode-0.13.1-cp27-cp27m-win_amd64.whl
Installing collected packages: ode
Successfully installed ode-0.13.1

C:\Users\Downloads>pip install cgkit-2.0.0-cp27-none-win_amd64.whl
Processing c:\users\sensei\downloads\cgkit-2.0.0-cp27-none-win_amd64.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

C:\Users\Downloads>python -m pip install --upgrade pip


Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

>viewer.py demo1.py

>viewer.py demo3.py

>render.py -rprman demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
gldistantlight: compiled.
glmaterial: compiled.
glpointlight: compiled.
glspotlight: compiled.
spotlight3ds: compiled.
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 0s

>sho out.tif
  • -
  • -

cgkit2.0.0 works under Fedora28

Fedora28でcgkit2.0.0+python2.7でビルドできました。boost-develをインストール。他checkenv.py で確認する。 py_slot.h,43行目snameに空白スペースを入れる"_" sname " py_geoms1.cpp,145行166行boost::python::make_tupleにしてbuildできました。ありがとうございます。


[@localhost ~]$ pip install cgkit==2.0.0
Collecting cgkit==2.0.0
Could not find a version that satisfies the requirement cgkit==2.0.0 (from versions: )
No matching distribution found for cgkit==2.0.0

Python Computer Graphics Kit v2.0.0
https://sourceforge.net/projects/cgkit/files/cgkit/cgkit-2.0.0/cgkit-2.0.0-py2k.tar.gz/download

[@localhost ~]$ sudo pip install pygame
Collecting pygame
Installing collected packages: pygame
Successfully installed pygame-1.9.4

[@localhost ~]$ sudo pip install ode
Collecting ode
Successfully installed ode-0.2.0

[mac@localhost ~]$ sudo pip install pyserial
Collecting pyserial
Installing collected packages: pyserial
Successfully installed pyserial-3.4

http://www.pythonware.com/products/pil/
[@localhost Imaging-1.1.7]$ sudo python setup.py install
Writing /usr/lib64/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info
creating /usr/lib64/python2.7/site-packages/PIL.pth

[@localhost utilities]$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.15 (default, Sep 21 2018, 23:26:48)
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. missing
cgkit (C++ lib)............... failed

The cgkit supportlib could not be imported. One possible reason for that
is that shared libraries (such as the boost_python runtime or OpenGL)
could not be found.

cgkit (all)................... failed

$ cd supportlib
$ # ...create & modify cpp_config.cpp if necessary...
$ scons
$ cd .. # if you were still in the supportlib directory
$ sudo python setup.py install

以下、error:
In file included from wrappers/py_arrayslots1.cpp:5:0:
wrappers/py_arrayslots1.cpp: In function ‘void class_ArraySlots()’:
wrappers/py_slot.h:43:75: error: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^
wrappers/py_slot.h:43:75: note: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~
wrappers/py_slot.h:43:75: error: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^
wrappers/py_slot.h:43:75: note: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

[solved]
py_slot.h,43行目snameの両側に空白スペースを入れる "_" sname "
[solved]
py_geoms1.cpp,line:145行 and line:166行 boost::python::make_tuple にしてbuildできました。
Thank you(^.^)

$viewer.py demo3.py
out.jpg
  • -
  • -

python cgkit has been installed on my Zorin-OS-12.4-Core-64

Virtualboxにubuntu系のZorinOSをインストールしました。
はじめにRenderMan互換rendererのpixieをインストールしました。詳しくは前の記事に書きました。
http://rman.sakura.ne.jp/sb/log/eid528.html

以下をインストールします。
$ sudo apt install python-dev
$ sudo apt install python-opengl
$ sudo apt install python-pygame
$ sudo apt install libboost-python-dev
$ sudo apt install python-pyode
$ sudo apt install libode-dev
$ sudo apt install python-serial
$ sudo apt install python-protocols
$ sudo apt install scons

ubuntuのpackageのpython-pilはインストールしません。
64bitの環境でcgkitでのテクスチャがうまく使えないので
PIL1.1.7をダウンロードしてきます。
http://www.pythonware.com/products/pil/

以下、pil1.1.7をubuntu系でインストールするための設定です。
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib

$ sudo apt install python-tk tk8.5-dev tcl8.5-dev tk8.5 tcl8.5
ここでtkinterが動くか確認します。大文字のTになっています。
$ python -m Tkinter

pil1.1.7を解凍します。
$ cd Downloads/
$ tar xvf Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7/

setup.pyの以下の部分にpathを書き加えます。
$ nano setup.py

TCL_ROOT = "/usr/include/tcl8.5/"
JPEG_ROOT = "/usr/lib/x86_64-linux-gnu/"
ZLIB_ROOT = "/usr/lib/x86_64-linux-gnu/"
TIFF_ROOT = None
FREETYPE_ROOT = "/usr/lib/x86_64-linux-gnu/"
LCMS_ROOT = None

pil1.1.7をビルドします。

python setup.py build_ext -i

pil1.1.7をインストールします。ログを記録します。
sudo python setup.py install --record files.txt

アンインストールするときは以下を使います。
cat files.txt | xargs rm -rf

running install_scripts
copying build/scripts-2.7/pilfile.py -> /usr/local/bin
copying build/scripts-2.7/pilprint.py -> /usr/local/bin
copying build/scripts-2.7/pilfont.py -> /usr/local/bin
copying build/scripts-2.7/pildriver.py -> /usr/local/bin
copying build/scripts-2.7/pilconvert.py -> /usr/local/bin
changing mode of /usr/local/bin/pilfile.py to 775
changing mode of /usr/local/bin/pilprint.py to 775
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pildriver.py to 775
changing mode of /usr/local/bin/pilconvert.py to 775
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/PIL/PIL-1.1.7.egg-info
creating /usr/local/lib/python2.7/dist-packages/PIL.pth
writing list of installed files to 'files.txt'

PIL1.1.7が動くか確認します。
~/Downloads/Imaging-1.1.7$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Image
>>>
ctrl+dで抜けます。

こちらでも確認します。
$ python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.

cgkitは--- ZLIB (PNG/ZIP) support okでないとテクスチャが渡せません。

cgkitを入手します。
https://sourceforge.net/projects/cgkit/files/cgkit/
以下はcgkitのインストールです。
$ cd ../
~/Downloads$ tar xvf cgkit-2.0.0-py2k.tar.gz

環境を確認します。
$ cd cgkit-2.0.0/
$ cd utilities/
$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. missing
cgkit (C++ lib)............... failed

The cgkit supportlib could not be imported. One possible reason for that
is that shared libraries (such as the boost_python runtime or OpenGL)
could not be found.

cgkit (all)................... failed

cgkitだけがインストールされてないので
以下を実行します。
$ cd ../
$ cd supportlib/
$ scons
しばらく待ちます。
scons: done building targets.
$ cd ../
$ sudo python setup.py install
しばらく待ちます。
running install_scripts
copying build/scripts-2.7/postbake.py -> /usr/local/bin
copying build/scripts-2.7/seqmv.py -> /usr/local/bin
copying build/scripts-2.7/seqrm.py -> /usr/local/bin
copying build/scripts-2.7/viewer.py -> /usr/local/bin
copying build/scripts-2.7/seqcp.py -> /usr/local/bin
copying build/scripts-2.7/convert3d.py -> /usr/local/bin
copying build/scripts-2.7/info3d.py -> /usr/local/bin
copying build/scripts-2.7/seqls.py -> /usr/local/bin
copying build/scripts-2.7/render.py -> /usr/local/bin
changing mode of /usr/local/bin/postbake.py to 755
changing mode of /usr/local/bin/seqmv.py to 755
changing mode of /usr/local/bin/seqrm.py to 755
changing mode of /usr/local/bin/viewer.py to 755
changing mode of /usr/local/bin/seqcp.py to 755
changing mode of /usr/local/bin/convert3d.py to 755
changing mode of /usr/local/bin/info3d.py to 755
changing mode of /usr/local/bin/seqls.py to 755
changing mode of /usr/local/bin/render.py to 755
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/cgkit-2.0.0.egg-info
... finished setup
インストール完了です。
$ cd utilities/
mak@zorinos:~/Downloads/cgkit-2.0.0/utilities$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0 (Nov 09 2018)
cgkit (C++ lib)............... OK
cgkit (all)................... OK

pythonで確認します。
$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cgkit.all import *
>>>

cgkitサイトのtutorialかdemoを入手します。
http://cgkit.sourceforge.net/tutorials/demo1.html
http://cgkit.sourceforge.net/tutorials/demo2.html
http://cgkit.sourceforge.net/tutorials/demo3.html
http://cgkit.sourceforge.net/tutorials/renderman.html
$viewer.py demo3.py

---------------------------------------------------------
cgkitのインストール時にエラーが出る場合
以下を参考にしてください。
以下、error:
In file included from wrappers/py_arrayslots1.cpp:5:0:
wrappers/py_arrayslots1.cpp: In function ‘void class_ArraySlots()’:
wrappers/py_slot.h:43:75: error: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^
wrappers/py_slot.h:43:75: note: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~
wrappers/py_slot.h:43:75: error: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^
wrappers/py_slot.h:43:75: note: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
---------------------------------------

[solved]
py_slot.h,43行目snameの両側に空白スペースを入れる "_" sname "

[solved]
py_geoms1.cpp,line:145行 and line:166行 boost::python::make_tuple に変更します。
  • -
  • -
<< 6/8 >>