Blender 2.5 Renderman exporter

Micro-polygon displacement for example is very nice.

renderman is a powerful way to descripe 3d scenes.
You have complete control of every single aspect of the rendering process. hence it opens lots of possibilites to optimize rendering for animations.
additionally the extra amount of control opens up room for hackish solutions for any kind of effect (using lights to not cast light but project textures, displacement or any other value you like; correct shadow mapped shadows http://www.3db-site.com/html/softShadow.php, etc).

you get correct motion blur, DOF, micro-poly displacement(with nearly no speed loss) and Point Based Occlusion with color bleeding.

and finally i wouldn’t say you have to write your own shaders but you CAN write your own shaders.
There are many good node based shader authoring tools out there that make shader writing very artist friendly and lots of free downloadable shader sources ready to use which completely eliminate the need to write the shader yourself.

Obviously by getting the chance to control all the parts of the rendering process you also have to know them all which makes some things a bit more complicated than they could. that could be seen as a downside but I’d consider it as a quite nice way to be forced to learn the details of the rendering process and therefore becoming capable of using them to my advantage.

Hey frigge,

i keep getting some errors, but maybe i am doing stuff wrong. I would like to ask if you could provide a very simple example file for rendering the monkey or something like that.

What kind of environment do you use for developing and testing? This is what i currently have:
Ubuntu Studio 64Bit Lucid, Blender 2.54 beta, pixie 2.2.6

Here is the error:

File “/home/ivo/svn/blender_scripts/scripts/addons/export_renderman.py”, line 2717, in maintain_searchpaths
maintain_searchpath(‘texture’, texpath+‘:’+shadowpath+‘:’+envpath)
File “/home/ivo/svn/blender_scripts/scripts/addons/export_renderman.py”, line 2710, in maintain_searchpath
slave_searchpath = current_pass.option_groups[“searchpath”]
KeyError: ‘bpy_prop_collection[key]: key “searchpath” not found’

got the same bug here sometimes. For some strange reason all the options are deleted for the current pass sometimes but i couldn’t track down the reason. Here the bug disappears when i reload the script.
My setup is more or less the same: Ubuntu 10.10 64bit blender 2.54 rev. 32654.

will look into it now.

still can’t spot the reason. For me the bug only occurs when creating a new image data and changing some values in the create popup. Sometimes blender is crashing completely, sometimes i get an error that lamp.data is suddenly empty and sometimes i get an UnicodeDecodeError telling me that it can’t decode the name of an object or some other random string.
Maybe it is a Blender Bug.
Loolarge how did you trigger the bug ?? Maybe it could help me isolate the issue if something else is triggering it for you.

I assumed the script was to be run with the 2.54 beta version, because when i attempt to activate the addon in r32654 i get this error:

TypeError: IntProperty(): ‘atmosphere_shader_parameter_index’ too long, max length is 31
Traceback (most recent call last):
File “/home/compile/blender/install/linux2/2.54/scripts/modules/bpy/utils.py”, line 398, in addon_enable
mod = import(module_name)
File “/home/ivo/svn/blender_scripts/scripts/addons/export_renderman.py”, line 1092, in <module>
max=1000)
ValueError: bpy_struct “Shader” registration error: atmosphere_shader_parameter_index could not register

edit: oh, i just realized that you switched from pixie to 3Delight;
It is weird, i keep getting different kinds of errors, i am not shure how to reproduce the previous bug. I think it happens when changing Lamp parameters.

that bug is caused by an outdated property which probably has a too long name (at least shortening its name from “atmosphere_shader_parameter_index” to “atmosphere_shader_index” solves that issue. Anyway that property is not used anymore so i deleeted it completely. Now it should work

The other bug you’ve shown me is a blender bug. I spoke with ideasman42 and he said it has to do with the Undo system. He tries to fix that asap but for now the problem is gone if you switch of global undu in the user preferences.

I’m really interessed in thisproject too, but I can’t find theway to make it run on my pc (windows xp and blender 2.54), I prefer Pixie than the other. A little installation tutorial would be very interesting, thanks for your efforts.

if you’ve already installed pixie it shouldn’t be too hard. Only copy the export_renderman.py to your /scripts/addons folder and the folders in the /presets folder to your /scripts/presets directory.
Then all you have to do is enable the addon from User Preferences->Addons, switch to “Renderman” in the Renderengine dropdown list and in the Properties “Render” TAB go to the “Renderman Settings” Panel and choose “Pixie” from the Renderengine Presets dropdown.

That should be enough to be able to render with Pixie.
The only two things you should then be aware of are to remember to enable the group called “searchpath” in the Render Properties Tab under “Options” so that Pixie can find all the shaders and to increase the intensity of your light sources as the default 1 is waaaay to small (consider something like 50).

If thats all not working for you, its a bug in my script. then you should copy your console output and paste it here.
thanks for testing it :slight_smile:

edit: and reload the script from my site! I’ve just uploaded a new version which has the crash and a slowdown bug solved

well … should have been testing it … changed quite a bit of the code to fix the crash and forgot to change even more -.-

fixing this right now … should work again in a few minutes.

EDIT: Should work again. Even solved an older bug :).

If something is still not working as expected, please let me know.

ok finally it should work on windows!

Please apologize that it took so long for me to solve that. I only got access to an ubuntu system so it was hard for me to spot the issue. But thanks to pgregory from the aqsis team i was finally able to fix it.

I also created a github repository. now its far easier to keep everything up to date.

the project url is: http://github.com/frigge/Blender-to-Renderman/

checkout the source via: git://github.com/frigge/Blender-to-Renderman.git

I’m also very interested in this project and would like to try it with Pixie. I’ve followed your install instructions but the script does not appear in my user preferences /addons tab.
I copied the export_renderman.py file into this location C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.55\scripts\addons

I’m running Blender 2.55 on win7 x64

It’s supposed to show up in the category “Render” and here it does. Any errors in the console ? Does it work if you load it in the text editor and hit “Run Script” ?

I’ve been trying to run this script on windows with pixie and aqsis
with pixie I get the error
" failed to find “H” "
same thing when I try to render from with the right click menu from the temp folder.
with aqsis after modifying the aqsis.py script to point to aqsis/bin and aqsis/shaders I get the errors
" cannot find the primary display(0) “framebuffer” " and " Invalid state for RiEnd (world) "
No problems so far running with aqsis on ubuntu.

seems like the script outputs a corrupt rib file on windows. could you upload or paste the rib file here so i can see whats going wrong? and also paste the python errors, if there are any.

Pixie Rib

Display “h:\docume~1\ed\locals~1\ emp\Scene\images\Beauty_rgba0001.framebuffer” “framebuffer” “rgba” “int[4] quantize” [0 65535 0 65535] “float[2] exposure” [1.0 1.0]
Format 960 540 1.0
ScreenWindow -1.0 1.0 -0.5625 0.5625
Clipping 0.10000000149 100.0
PixelFilter “box” 1.0 1.0
PixelSamples 2 2
Option
“searchpath”
“string shader” [“H:\Program Files\Pixie\shaders:”]
“string texture” [“h:\docume~1\ed\locals~1\ emp\Scene\ extures:h:\docume~1\ed\locals~1\ emp\Scene\shadowmaps:h:\docume~1\ed\locals~1\ emp\Scene\envmaps”]
Hider “hidden”

Orientation “lh”
Projection “perspective” “fov” [21.3206965891]
Scale 1 1 -1
Rotate -63.5592952084 1 0 0
Rotate -0.619767950192 0 1 0
Rotate -46.6919449776 0 0 1
Translate -5.72090864182 16.1433105469 -4.60527610779

WorldBegin

Surface “matte”

AttributeBegin
ConcatTransform [ 0.775086939335 0.461986601353 0.431055605412 0.0
-0.521989762783 0.0837571620941 0.848829686642 0.0
0.356043726206 -0.882923007011 0.306071162224 0.0
4.42030525208 -15.62778759 5.39791297913 1.0]
LightSource “distantlight” “Lamp”
“uniform point from” [0.0 0.0 0.0]
“uniform float intensity” [1.0]
“uniform color lightcolor” [1.0 1.0 1.0]
“uniform point to” [0.0 0.0 -1.0]
AttributeEnd

Illuminate “Lamp” 1

##Cube
AttributeBegin
Attribute “identifier” “name” [“Cube”]
ConcatTransform [ 1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0]
ReadArchive “h:\docume~1\ed\locals~1\ emp\Scene\Materials\Material_Beauty.rib”
ShadingRate 1.0
ReadArchive “h:\docume~1\ed\locals~1\ emp\Scene\Mesh\Cube0001.rib”
AttributeEnd

WorldEnd

Pixie Console

adding searchpath
adding limits
adding statistics
adding trace
adding hidden
adding photon
adding raytrace
adding zbuffer
adding cull
adding dice
adding displacementbound
adding irradiance
adding photon
adding shade
adding trace
adding visibility
adding cull
adding dice
adding displacementbound
adding irradiance
adding photon
adding shade
adding trace
adding visibility
adding cull
adding dice
adding displacementbound
adding irradiance
adding photon
adding shade
adding trace
adding visibility
adding cull
adding dice
adding displacementbound
adding irradiance
adding photon
adding shade
adding trace
adding visibility
shader has changed
immer??
something else has changed
pass wieder rausgeschmissen
adding cull
adding dice
adding displacementbound
adding irradiance
adding photon
adding shade
adding trace
adding visibility

Presetspath not found. Creating:
h:\docume~1\ed\locals~1 emp\Scene\images
write Scene Settings …

Done
write Camera Settings …
Done
write Lamp
Done
write Cube
Done
Render … Beauty
rndr h:\docume~1\ed\locals~1 emp\Scene\Beauty0001.rib
Failed to find “h”

Aqsis Rib

Display “h:\docume~1\ed\locals~1\ emp\Scene\images\Beauty_rgba0001.framebuffer” “framebuffer” “rgba” “int[4] quantize” [0 65535 0 65535] “float[2] exposure” [1.0 1.0]
Format 960 540 1.0
ScreenWindow -1.0 1.0 -0.5625 0.5625
Clipping 0.10000000149 100.0
PixelFilter “box” 1.0 1.0
PixelSamples 2 2
Option
“searchpath”
“string shader” [“H:/Program Files/Aqsis/shaders:H:\Program Files\Aqsis\shaders\light\:H:\Program Files\Aqsis\shaders\surface\:H:\Program Files\Aqsis\shaders\include\:H:\Program Files\Aqsis\shaders\displacement\:H:\Program Files\Aqsis\shaders\imager\:H:\Program Files\Aqsis\shaders\volume\:”]
“string texture” [“h:\docume~1\ed\locals~1\ emp\Scene\ extures:h:\docume~1\ed\locals~1\ emp\Scene\shadowmaps:h:\docume~1\ed\locals~1\ emp\Scene\envmaps”]
Orientation “lh”
Projection “perspective” “fov” [21.3206965891]
Scale 1 1 -1
Rotate -63.5592952084 1 0 0
Rotate -0.619767950192 0 1 0
Rotate -46.6919449776 0 0 1
Translate -5.72090864182 16.1433105469 -4.60527610779

WorldBegin

Surface “matte”
“uniform float Ka” [1.0]
“uniform float Kd” [1.0]

AttributeBegin
ConcatTransform [ 0.775086939335 0.461986601353 0.431055605412 0.0
-0.521989762783 0.0837571620941 0.848829686642 0.0
0.356043726206 -0.882923007011 0.306071162224 0.0
4.42030525208 -15.62778759 5.39791297913 1.0]
LightSource “distantlight” “Lamp”
“uniform point from” [0.0 0.0 0.0]
“uniform float intensity” [1.0]
“uniform color lightcolor” [1.0 1.0 1.0]
“uniform point to” [0.0 0.0 -1.0]
AttributeEnd

Illuminate “Lamp” 1

##Cube
AttributeBegin
Attribute “identifier” “name” [“Cube”]
ConcatTransform [ 1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0]
ReadArchive “h:\docume~1\ed\locals~1\ emp\Scene\Materials\Material_Beauty.rib”
ShadingRate 1.0
ReadArchive “h:\docume~1\ed\locals~1\ emp\Scene\Mesh\Cube0001.rib”
AttributeEnd

WorldEnd

Aqsis Console

adding searchpath
adding limits
adding render
adding shadow
adding hidden
adding aqsis
adding autoshadow
adding dice
adding trimcurve
adding aqsis
adding autoshadow
adding dice
adding trimcurve
adding aqsis
adding autoshadow
adding dice
adding trimcurve
adding aqsis
adding autoshadow
adding dice
adding trimcurve
shader has changed
immer??
something else has changed
pass wieder rausgeschmissen
adding aqsis
adding autoshadow
adding dice
adding trimcurve
shader has changed
shader has changed

Presetspath not found. Creating:
h:\docume~1\ed\locals~1 emp\Scene\images
write Scene Settings …

Done
write Camera Settings …
Done
write Lamp
Done
write Cube
Done
Render … Beauty
aqsis h:\docume~1\ed\locals~1 emp\Scene\Beauty0001.rib
11/13/2010 19:36:56 ERROR: (3, 2) Cannot find the primary display(0) driver “fra
mebuffer”
11/13/2010 19:36:56 ERROR: Invalid state for RiEnd [World]

Thanks for the quick reply! I’m at work now and have just tried it on my work machine. I have the same problem of it not showing up under “render” tab in “addons”

This is the error showing up in console after trying to run the script from script editor

File “export_renderman.py”, line 6
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”

SyntaxError: invalid syntax

location:<unknown location>:-1

I don’t know how to copy and paste from the console so I have retyped it here.
Hope this helps!