• Joseph Montanez

    Joseph Montanez - 2005-09-12

    Is it:
    RiProcDelayedReadArchive() ?
    If so in the docs says I cant use it directly. But why not? Its just another rib files withe bounds right?

    • Matthias Baas

      Matthias Baas - 2005-09-12

      >Is it:
      >RiProcDelayedReadArchive() ?
      >If so in the docs says I cant use it directly.

      I suppose you are referring to this sentence:
      "It is not possible to use your own procedurals directly in the RIB generating program,..."

      In the RenderMan API procedurals are created using the RiProcedural() call. In a C client library that comes with a renderer you could pass your own function pointers to RiProcedural() that get called during rendering.
      This is not possible in a client library that only dumps RIB requests (such as in cgkit). But fortunately, the RenderMan API defines three special procedurals that can also be encoded as RIB, and that's the DelayedReadArchive, RunProgram and DynamicLoad procedurals. These actually *can* be used in Python (the above sentence from the documentation means that you can *only* use these three but not define your own Python functions that could be passed to RiProcedural()). So a DelayedReadArchive procedural is also created by calling RiProcedural() with the special "function" RiProcDelayedReadArchive. You can obtain a short help about RiProcedural() (with examples) in an interactive Python shell by calling the following:

      >>> from cgkit.ri import *
      >>> help(RiProcedural)
      Help on function RiProcedural in module cgkit.ri:

      RiProcedural(data, bound, subdividefunc, freefunc)
          Declare a procedural model.

          Note: Here you can only use the predefined standard procedurals:
          RiProcDelayedReadArchive, RiProcRunProgram, RiProcDynamicLoad.

          Example: RiProcedural("mymodel.rib", [-1,1,-1,1,-1,1], \                           RiProcDelayedReadArchive, RI_NULL)

                   RiProcedural(["python",""],[0,1,0,1,0,1], \                           RiProcRunProgram, RI_NULL)

                   RiProcedural(["",""],[0,1,0,1,0,1], \                           RiProcDynamicLoad, RI_NULL)

      There is also an example in the Aqsis regression test suite:

      - Matthias -


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks