Rendering学習日記

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

Indirectlight

3Delightのindirectlightを追加できるようにした。
メタセコイアのオブジェクトパネルにidirectlightとぶつを追加して、
metasequoia python スクリプトでRIB出力
以下はライト部分RIB抜粋、結構レンダリング時間かかります。
Attribute "visibility" "trace" [1]
Attribute "visibility" "transmission" ["Os"]
Attribute "visibility" "transmission" "opaque"
Attribute "light" "shadows" "on"
TransformBegin
Translate 3.0 300.0 -3.0
LightSource "maya_pointlight" 1
"lightcolor" [0.800 0.800 0.800]
"string shadowmapname" "raytrace"
"float intensity" 50000

TransformEnd
LightSource "spotlight" 2
"from" [-64.2728729248 115.28918457 96.3978881836]
"to" [-0.649001300335 10.0252351761 -12.1598510742]
"lightcolor" [0.800 0.100 0.100]
"string shadowmap" "raytrace"
"float intensity" 80000
"float coneangle" 0.52
"float conedeltaangle" 0.52

LightSource "maya_spotlight" 3
"from" [127.575531006 153.345001221 -69.9409103394]
"to" [42.3550758362 20.9788990021 -12.4399051666]
"lightcolor" [0.100 0.100 0.800]
"string shadowmapname" "raytrace"
"float intensity" 1.0
"float coneangle" 0.8
"float penumbraangle" 0.15

TransformBegin
Translate 0 10 0
LightSource "indirectlight" "ambientLightShape1"
"uniform float intensity" [ 1 ]
"uniform float finalgather" [ 1 ]
"uniform float samples" [ 256 ]
"uniform float maxdist" [ 0.99999997e36 ]
"uniform float __nonspecular" [ 1 ]
TransformEnd


楽しいですね。
scene06.jpg
  • -
  • -

Tkinter使えない??

メタセコイアpythonでTkinter実験君。
単にウインドウを表示しようとしたが、うまくいかない。
def p(*args):
"""
プリント関数
複数の引数を渡せる。
"""
if len(args)==0:
# 改行させる
MQSystem.println("")
return

for arg in args:
MQSystem.println(str(arg))

import traceback
import sys
from Tkinter import *

try:
r=Tk()
except:
info=sys.exc_info()
p(info[0])
p(info[1])
p(*traceback.extract_tb(info[2]))

エラーは以下のとおり・・・・残念??
exceptions.AttributeError
'module' object has no attribute 'argv'
('C:\\Users\\makura\\Documents\\tk_error.py', 19, '?', 'r=Tk()')
('c:\\Python22jp\\Lib\\lib-tk\\Tkinter.py', 1507, '__init__', 'baseName = os.path.basename(sys.argv[0])')
  • -
  • -

文字列操作

メタセコイアのPythonを使えるようになるために。
python 2.2.3インタラクティブモードで文字列操作を検証してみた。

>>> tex="texture01.jpg"

>>> print tex[:-4]
texture01

>>> print tex[-4:]
.jpg

>>> print tex[:-4]+".tif"
texture01.tif

>>>

これで、テクスチャ名の変更できますね。ありがとうございます。
  • -
  • -
<< 9/11 >>