<< Python モジュール 64bit版 戻る TypeError: 'module' object is not callable >>

import prmanでのsearchpath

ri.Begin()の後にOptionのsearchpathは書かないとだめ。
てっきり前に書くもんだと思い込み。

A00002 {WARNING} Unknown unqualified RiOption context: searchpath.

以下は、参考スクリプト

# set PYTHONPATH=C:\Python25;C:\Python25\Scripts;%RMANTREE%\bin # this is where prman.py lives
import prman
ri = prman.Ri() # create an instance of the RenderMan interface
rendertarget = "helloworld.rib"
ri.Option("rib", {"string asciistyle": "indented"})

ri.Begin(ri.RENDER) # set rendertarget to ri.RENDER to render pixels
ri.Option("ribparse", {"string varsubst":["$"]})
ri.Option("searchpath", {"string shader": "RC:&"})

#ri.Imager ("background", {"color color":(.2, .4, .6)})
ri.Display("teapot4.png", "framebuffer", "rgb")
ri.Format(512,480,1)
ri.Projection(ri.PERSPECTIVE, {ri.FOV: 45}) # standard Ri tokens are available
ri.ShadingRate(0.25)
#ri.Translate(0,0,10)
ri.Rotate(-33.69, 1.00, 0.00, 0.00)
ri.Translate(0.00, -4.00, 8)
ri.WorldBegin()

ri.LightSource("shadowdistant",{ri.HANDLEID:"2", "from": [ -10, 10, -10], "to": [ 0, 0, 0], "intensity":[2.0], "string shadowname": ["raytrace"]})
#ri.LightSource( "pointlight",{ri.HANDLEID:"1","from": [-10, 10, -10], "intensity" :[300]})
#ri.LightSource( "pointlight",{ri.HANDLEID:"2","from": [10, 10, -10], "intensity" :[300]})
#ri.LightSource( "pointlight",{ri.HANDLEID:"3","from": [-10, -10, -10], "intensity" :[300]})

ri.AttributeBegin()
size=20.0
ri.Attribute( "visibility", {"trace": [1]})
ri.Attribute( "visibility", {"int transmission": [0]})
ri.TransformBegin()
ri.Color(( .2773, .2855, .6679))
ri.Surface( "DPCloudPlane")
ri.Sphere(size, -size, size,360)
ri.TransformEnd()
ri.AttributeEnd()

ri.AttributeBegin()
ri.Attribute( "visibility", {"trace": [0]})
ri.Attribute( "visibility", {"int transmission": [1]})
ri.TransformBegin()
ri.Color(( 0.9, 0.9, 0.9))
ri.Surface( "shinymetal", {"string texturename": ["raytrace"]})
#ri.Translate( 1, 0, 0)
ri.Translate( -1, -2, 0)
ri.Rotate( -90, 1, 0, 0)
ri.Geometry("teapot")
ri.TransformEnd()
ri.AttributeEnd()

ri.AttributeBegin()
size=1.0
ri.Attribute( "visibility", {"trace": [1]})
ri.Attribute( "visibility", {"int transmission": [1]})
ri.TransformBegin()
ri.Color(( 1, 0.1, 0))
ri.Surface( "plastic")
ri.Translate( 1, -1, -3)
ri.Rotate( -90, 1, 0, 0)
ri.Sphere(size, -size, size,360)
ri.TransformEnd()
ri.AttributeEnd()


ri.AttributeBegin()
ri.Attribute( "visibility", {"trace": [1]})
ri.Attribute( "visibility", {"int transmission": [1]})
ri.TransformBegin()
face=[-5,-2,-5, 5,-2,-5,-5,-2,5, 5,-2,5]
ri.Color(( 0.99, 0.99, 0.99))
#ri.Surface( "checker", {"float Kd":[0.5],"float Ka":[0.1], "float frequency":[6.0], "color blackcolor":[0.2,0.8,0.5]})
ri.Surface( "blue_marble")
ri.Patch("bilinear",{'P':face})
ri.TransformEnd()
ri.AttributeEnd()

ri.WorldEnd()
ri.End()
  • -
  • -

<< Python モジュール 64bit版 戻る TypeError: 'module' object is not callable >>