26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ErrorHandler ”ignore”<br />

ErrorHandler ”print”<br />

ErrorHandler ”abort”<br />

If ”ignore”, ”print”, or ”abort” is specified, the equivalent predefined error handling<br />

procedure will be invoked in the RIB server. Notice that the RIB parser process may<br />

detect RIB stream syntax errors which make it impossible to correctly parse a request.<br />

In this case, the error procedure will be invoked and the parser will do its best to<br />

resynchronize the input stream by scanning for the next recognizable token.<br />

EXAMPLE<br />

ErrorHandler ”ignore”<br />

7.3 Archive Files<br />

One important use of the RIB protocol is to store a scene description in an archive file for<br />

rendering at a later time or in a remote location from the modeling application. Appendix<br />

D, <strong>RenderMan</strong> <strong>Interface</strong> Bytestream Conventions, outlines a structuring conventions to<br />

make these archives as portable and useful as possible.<br />

RiArchiveRecord ( RtToken type, char *format [, arg ...] )<br />

This call writes a user data record (data which is outside the scope of the requests<br />

described in the rest of Part I of this document) into a RIB archive file or stream.<br />

type is one of ”comment”, or ”structure”, or ”verbatim”. ”comment” begins the user<br />

data record with a RIB comment marker and terminates it with a newline. ”structure”<br />

begins the user data record with a RIB structuring convention preface and terminates<br />

it with a newline. ”verbatim” just outputs the data as-is, with no leading comment<br />

character and no trailing newline. <strong>The</strong> user data record itself is supplied as a printf()<br />

format string with optional arguments. It is an error to embed newline characters in<br />

the format or any of its string arguments.<br />

RiReadArchive ( RtToken name, RtVoid (*callback)(RtToken,char*,...), ...parameterlist...)<br />

This function will read the named file. Each RIB command in the archive will be<br />

parsed and executed exactly as if it had been called by the application program directly,<br />

or been in-line in the calling RIB file, as the case may be. This is essentially a<br />

RIB-file include mechanism.<br />

In the C API version, the callback parameter is a function which will be called for any<br />

RIB user data record or structure comment which is found in the file. This routine<br />

104

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!