# Documentation/RIB Resources

### From PixieWiki

< Documentation

# [edit] ArchiveBegin / ArchiveEnd

By placing a section of RIB inbetween `ArchiveBegin` and `ArchiveEnd` you create a named resource which can be recalled within the same render. This allows you to place repeated sections of RIB in one section which can be included in multiple locations. The `ReadArchive` and `DelayedReadArchive` RIB requests can be used to recall a previously saved RIBlet.

    ArchiveBegin "riblet.rib"
      Attribute "dice" "rasterorient" 0
      Attribute "cull" "backfacing" 0
      Attribute "cull" "hidden" 0
      Surface "complexShader" "lotsOfParams1" value1 "lotsOfParams2" value2 "lotsOfParams3" value3
    ArchiveEnd
    #...
    ReadArchive "riblet.rib"
    Sphere 1 -1 1 360
    #...
    ReadArchive "riblet.rib"
    Sphere 1 -1 1 360

The saved RIBlet can also be recalled in RIB files that you ReadArchive - which allows RIB templating.

# [edit] Resources

The new `Resource` RIB request allows selective saving and restoring of attributes fro within a RIB.

    Resource "<name>" "<type>" "string operation" "<operation>"

or

    Resource "<name>" "<type>" "string operation" "<operation>" "string subset" "<subset>"

Can be used to save and restore attributes to or from a named saved resource.

Operation can be:

`"save`
  save the attributes to the named handle
`"restore`
  restore the named attributes

Subset can be:

`"shading"`
  The shaders, surface color, opacity, active lights, irradiance handle and photonmap settings
`"geometrymodification"`
  Sidedness of geometry, and detail ruler settings (RiDetail)
`"geometrydefinition"`
  patch basis and name identifier
`"hiding"`
  hider settings
`"transform"`
  restore the transform
`"all"`
  all the above (default)

Additionally, `ResourceBegin` and `ResourceEnd` allow the scope of saved `Resource` sets to be controlled, which helps with pipelines which have many embedded `ReadArchive` calls in them.

Retrieved from "http://www.george-graphics.co.uk/pixiewiki/Documentation/RIB_Resources"

##### Views

- Article
- Discussion
- Edit
- History

##### Personal tools

- Log in / create account

##### Search

##### Toolbox

- What links here
- Related changes
- Upload file
- Special pages
- Printable version
- Permanent link