GridData
 
 
 

GridData

This example contains a Python and a C++ implementation of the grid data.

Running the Example

To run the example

  • Load an existing scene containing 3D objects and materials. Then, execute either the "GDE_Create3DOGrid" command (Python example) or the "GDE_CreateCPPGrid" command (CPP example). The grid data will be displayed



    Python Example ("GridDataExample.py")

    Once the plug-in is loaded, executing the "GDE_Create3DOGrid" command will create a new Custom Property called "GDE_3DOGrid", in which a grid data parameter called "Data" will be created.

    The grid data will contain one row per 3DObject in the scene, and the following is implemented in the Python plug-in:

    • 3DObject rows are using a green background color
    • Model rows are using a blue background color
    • Selecting a cell in the "Object" color will select the object in the scene
    • A refresh button can be pushed to synchronize changes from the scene to the grid data
    • A dump button to log the contents of the grid data in the script log
    • A contextual menu allows setting the read-only flags on selected cells

    Details about the different columns in the example:

    • Object
      • Uses the siColumnStandard column type
      • Lists the object names
      • Selecting the cell changes the scene selection
      • The plug-in blocks value changes for this column, using the return value in "OnBeginValueChange"
    • ID
      • Uses the siColumnInt column type
      • Lists the object IDs
      • The plug-in blocks selection for this column, using the return value in "OnBeginSelectionChange"
    • Vis
      • Uses the siColumnBool column type
      • Clicking on the checkmark will hide/show the object
    • Color
      • Uses the siColumnColor column type
      • Clicking on the cell will let the user choose a wireframe display color for the object
    • Image
      • Uses the siColumnImageClip column type
      • Double-clicking will inspect the associated imageclip in a PPG
      • A contextual menu lets the user select an image file
    • ShaderBall
      • Uses the siColumnShaderBall column type
      • Double-clicking will inspect the associated material in the render tree
      • A contextual menu lets the user pick a material in the scene
    • Set Uni. Scl.
      • Uses the siColumnFloat column type
      • Editing the value will force uniform local scaling values for the object
    • Translation
      • Uses the siColumnVector column type
      • Editing the value will set the local translation values for the object
    • Static Selection
      • Uses the siColumnCombo column type
      • Will affect the Selected/Static parameter under the Display property for the object
    • Delete
      • Uses the siColumnButton column type
      • Will delete the object from the scene once pushed
    • File
      • Uses the siColumnFile column type
      • Double-clicking will launch a file browser that allows setting the file
    • Comment
      • Uses the siColumnMultiLine column type


    CPP Example ("GridDataExampleCPP.cpp")

    Once the plug-in is loaded, executing the "GDE_CreateCPPGrid" command will create a new Custom Property called "GDE_CPPGrid", in which a grid data parameter called "Data" will be created.

    The grid data contains 5 rows. The last row ("Sum") will sum all the data, per column, when possible.

    The last row ("Sum") is not editable.

    The custom property also displays a dump button to log the contents of the grid data in the script log

    The column headers show what column types are used for the column. Here is additional details about some of the columns:

    • siColumnImageClip
      • The assigned images are taken from the scene that is loaded at the time the "GDE_CreateCPPGrid" command was executed
    • siColumnButton
      • Pressing the button will assign the color in the "siColumnColor" colum as the background color for the whole row
    • siColumnShaderBall
      • The assigned materials are taken from the scene that is loaded at the time the "GDE_CreateCPPGrid" command was executed.

Keywords

This example uses the following keywords:

Python example, CPP example, GridData, self-installed plug-in