Is anyone aware of a project or source code examples where I can convert usd scenes directly to rib (usd2rib command line tool?) or where to look to see how the prman hydra delegate actually sends the data to prman (I have looked through the code but finding it hard to pin down a start area I was guessing it would pipe rib commands to the prman stdin but can’t find this anywhere).
At present I use the renderman python API to teach python programming on my course and would like to move to using usd but have the option to dump this to rib (without the use of a DCC).
I’m happy to write my own but need to advice on where to start etc.
I’ve done a fair amount of this work, but I don’t know about exactly what/if I can share, I will come back to you about this.
In the meanwhile, more than happy to talk about it.
Just an idea where to start would be good, I know it can feed the data directly to renderman so I guess intercepting this and writing it to rib would be a start, Is this the approach you are using? If not where else should I look?
Can I actually ask you a question about this ?
Would you be keen to start teaching OpenUSD API, in python, and still render in Renderman ? Why would you still need a RIB file ?
Sorry about these questions, I’m just trying to have a full picture of the situation to provide a proper suggestion
I come from years of Renderman programming (renderman first and our Manuka renderer RIB-compliant now), from shadeops, riffilters, etc, and yes, I’ve done usd-to-rib translators, and also a SceneIndex plugin to RIB (incomplete though)…
but…I think you might actually be fine just going straight to OpenUSD in python and still render in Renderman.
But I don’t know what you are teaching in your course. Do you have an example ?
This is what I currently do Renderman Lectures | Jon Macey's WebPages basically show a bit of rib, then go to the original python API for teaching the rest.
Have tried using the new(ish) python bindings but not everything is 100% supported. I’m actually do some USD in another unit, but thought having a way of exporting rib would be fun as well.
Also this sort of thing is quite useful to suggest as projects for the MSc students.
I love what you are doing
OK, there are various ways in which you could approach this, and I can mention some, and probably miss others.
If you need to go from OpenUSD to RIB for the entire scene, without getting too much into usd plugins and just using OpenUSD API to basically read a usd file, you could do a simple app (python or c++) that reads a usd and writes a RIB in which you have to translate usd-prim-types to ri by yourself and you can write it to disk setting up a proper Ri Begin or just straight ascii.
There are some helper functions in the UsdRi module to help you with conversions for interpolation/declarations, in case you need it.
If you don’t need the entire scene from the usd file, and you are happy to setup camera/etc (pre-WorldBegin) in Ri, you could write an RiProcedural/RiProcedural2 to read a usd fileformat as geometry (which it can obviouly be used to capture to rib too, and it’s pretty straight forward).
If you actually want to get more into OpenUSD plugins, then other possibilities are available, but it’s probably more work as OpenUSD than Renderman API.
About your initial question, other might know more about it, but I think the hdPrman delegate uses the new Riley interface, instead of the old Ri.
You could see how that works, but you are really doing Hydra to Ri/Riley in there, instead of USD to Ri/Riley.
Thanks, I will have a deeper look. Not actually looked at the Riley interface do you know if there is any open documentation on it?
I think I may dig in an have a go with the C++ / Python route just as it gives me more chance of learning the ins and outs of the API (only just scratched the surface so far and we keep getting students who want to use it).
Yep managed to find them, useful as ever “The APIs allow callers to configure a physically based renderer, and create / modify / delete rendering entities.” Time for a play. Thanks for your help