Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

To fully understand this tutorial, you will need some scripting knowledge (in this case Python) and some basic knowledge of the Softimage SDK. But you do not need any compiler or developer's SDK installed, everything you need is in the 3Delight for Softimage package.

This tutorials tutorial mentions the "RIB" files format extensively but you don't need to know the technicalities of this format. If you are interested you can read more about the RenderMan Interface Byestream here: https://renderman.pixar.com/products/rispec/index.htm.

...

Since the RIB archive is a geometry property it needs a host that will support it. Most of the time it should be a simplified representation of the real object. In this tutorial we will first show you how to create a host that will cover the bounding box of the original object. To be more pipeline oriented, we will We can use a simple Python script in order to generate the bounding box of a selected a bounding box that will act as a hots for the original object :

  1. Open Softimage’s script editor and add the following Python code (make sure the scripting language is set to Python):

    Code Block
    languagepy
    titleSoftimage - Python
    firstline1
    linenumberstrue
    import os
    # First verify if you have an object selected
    if( len( Application.Selection ) > 0 ):
        object = Application.Selection( 0 )
        # Get the bounding box of the object
        bounding_box = Application.GetBBox(  )
        bb_x_min = bounding_box( 0 )
        bb_y_min = bounding_box( 1 )
        bb_z_min = bounding_box( 2 )
        bb_x_max = bounding_box( 3 )
        bb_y_max = bounding_box( 4 )
        bb_z_max = bounding_box( 5 )
        # Create the host of RIB property. We are using a mesh in order to use any SI property on it.
        cube_bounding_box = Application.ActiveSceneRoot.AddGeometry( 'Cube', 'MeshSurface' )
        cube_bounding_box.Name = object.Name + '_BBox'
        cube_bbox_final_name = object.Name
        cube_bounding_box.length = 1
        # The host of the RIB property should cover the bounding box of the original object.
        cube_bounding_box.PosX = ( bb_x_max + bb_x_min ) / 2
        cube_bounding_box.PosY = ( bb_y_max + bb_y_min ) / 2
        cube_bounding_box.PosZ = ( bb_z_max + bb_z_min ) / 2
        cube_bounding_box.sclx = bb_x_max - bb_x_min
        cube_bounding_box.scly = bb_y_max - bb_y_min
        cube_bounding_box.sclz = bb_z_max - bb_z_min
        Application.FreezeObj( cube_bounding_box )
  2. Select an object
  3. Execute the script

This will generate the bounding box of the selected object. Now Now that this is done, we need to create the RIB archive and assign it to the bounding box using the RIB archive property.
To  To perform this action add the following code line to the previous file:

...