Main Page | Class Hierarchy | Alphabetical List | Compound List | Compound Members

# IRiSpaceCommand Struct Reference

Inherits IDispatch.

List of all members.

## Public Member Functions
HRESULT | NewScene (void)
HRESULT | Select (BSTR name)
HRESULT | Unselect (void)
HRESULT | DisplayAll (void)
HRESULT | NodeConList ([in] BSTR name)
HRESULT | Sphere ([in] RtDouble dRadius,[in] RtUlong latitude,[in] RtUlong longitude,[out, retval] BSTR *pVal)
HRESULT | Torus ([in] RtDouble dRadius,[in] RtUlong latitude,[in] RtUlong longitude,[out, retval] BSTR *pVal)
HRESULT | Cube ([in] VARIANT cx,[in] VARIANT cy,[in] VARIANT cz,[in] VARIANT rcx,[in] VARIANT rcy,[in] VARIANT rcz,[out, retval] BSTR *pVal)
HRESULT | CurrentScene ([out, retval] BSTR *pVal)
HRESULT | ApplyDeform ([in] VARIANT ObjName,[in] BSTR deformType,[out, retval] BSTR *pVal)
HRESULT | NURBSCube ([in] VARIANT cx,[in] VARIANT cy,[in] VARIANT cz,[in] VARIANT sx,[in] VARIANT sy,[in] VARIANT sz,[out, retval] BSTR *pVal)
HRESULT | NURBSSphere ([in] VARIANT radius,[out, retval] BSTR *pVal)
HRESULT | NURBSTorus ([in] VARIANT radius1,[in] VARIANT radius2,[out, retval] BSTR *pVal)
HRESULT | NURBSCone ([in] VARIANT radius1,[in] VARIANT radius2,[in] VARIANT height,[out, retval] BSTR *pVal)
HRESULT | AdjustMatManager ([in] BSTR bstrObjName,[in] RtDWORD dwNumCons)
HRESULT | SaveScene ([in] BSTR bszSceneFileName)
HRESULT | LoadScene ([in] BSTR bszSceneFileName)
HRESULT | RemEulerTrans ([in] BSTR bstrName)
HRESULT | ConvertToMatList ([in] BSTR bstrEncapsName,[in] BSTR bstrActiveClass)
HRESULT | AutoRunActivities ()
HRESULT | LoadRsScnFile ([in] BSTR bszFileName)
HRESULT | EnableCollision ([in] BSTR bstrObjName,[in] BOOL bEnable)
HRESULT | NodeMatrixElement ([in] BSTR szNodeName,[in] BSTR szElemName,[out, retval] VARIANT *pVal)
HRESULT | NodeMatrixElement ([in] BSTR szNodeName,[in] BSTR szElemName,[in] VARIANT newVal)

## Detailed Description

The IRiSpaceCommand interface provides methods for scene and scene objects - related operations. It can clear the scene, save/load the scene, create primitive objects etc.
Root-level name in the scripting engine's name space: Space

## Member Function Documentation

HRESULT IRiSpaceCommand::NewScene | ( | void |  | ) |

| Creates new scene (erasing the current one, so be carrefull).

HRESULT IRiSpaceCommand::Select | ( | BSTR | name | ) |

  | Selects the given object. Parameters:
  name | – full name of object to be selected

HRESULT IRiSpaceCommand::Unselect | ( | void |  | ) |

| Unselect everything.

HRESULT IRiSpaceCommand::DisplayAll | ( | void |  | ) |

| Displays basic informations about all objects on the scene to the output console.

HRESULT IRiSpaceCommand::NodeConList | ( | [in] BSTR | name | ) |

| Displays information about object's connectors to the output console.

HRESULT IRiSpaceCommand::Sphere | ( | [in] RtDouble | dRadius,
|  | [in] RtUlong | latitude,
|  | [in] RtUlong | longitude,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates Sphere primitive Parameters:
  dRadius | – radius of the sphere (float value)
  latitude | – latitude of the sphere (integer value)
  longitude | – longitude of the sphere (integer value)
  pVal | – returns full name of sphere object created. Note – object will be created in current scene
Example:
     Space.Sphere(1.5, 6, 6)

HRESULT IRiSpaceCommand::Torus | ( | [in] RtDouble | dRadius,
|  | [in] RtUlong | latitude,
|  | [in] RtUlong | longitude,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates Torus primitive Parameters:
  dRadius | – radius of the toruse (float value)
  latitude | – latitude of the torus (integer value)
  longitude | – longitude of the torus (integer value)
  pVal | – returns full name of torus object created. Note – object will be created in current scene
Example:
     Space.Torus(2.0, 10, 10)

HRESULT IRiSpaceCommand::Cube | ( | [in] VARIANT | cx,
|  | [in] VARIANT | cy,
|  | [in] VARIANT | cz,
|  | [in] VARIANT | rcx,
|  | [in] VARIANT | rcy,
|  | [in] VARIANT | rcz,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates Cube primitive Parameters:
  cx | – x size of cube (float value)
  cy | – y size of cube (float value)
  cz | – z size of cube (float value)
  rcx | – x resolution (number of components) (integer value)
  rcy | - y resolution (number of components) (integer value)
  rcy | - z resolution (number of components) (integer value)
  pVal | – returns full name of cube object created. Note – object will be created in current scene
Note: Number of vertices of cube created will be 2 * (rcx * rcy + rcy * rcz + rcz * rcx + 1) Example:
     Space.Cube(2.0, 2.0, 2.0, 1, 1, 1)

HRESULT IRiSpaceCommand::CurrentScene | ( | [out, retval] BSTR * | pVal | ) |

  | Returns full name of current scene. Parameters:
  pVal | – full name of current scene

HRESULT IRiSpaceCommand::ApplyDeform | ( | [in] VARIANT | ObjName,
|  | [in] BSTR | deformType,
|  | [out, retval] BSTR * | pVal
| ) |

  | Apply deform to given object. Parameters:
  ObjName | – full name of object
  deformType | – deformation type ('twist' or 'taper')
  pVal | - returns full name of final deform object

HRESULT IRiSpaceCommand::NURBSCube | ( | [in] VARIANT | cx,
|  | [in] VARIANT | cy,
|  | [in] VARIANT | cz,
|  | [in] VARIANT | sx,
|  | [in] VARIANT | sy,
|  | [in] VARIANT | sz,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates NURBS Cube. Parameters:
  cx | – x size of cube (float value)
  cy | – y size of cube (float value)
  cz | – z size of cube (float value)
  sx | – number of subdivisions in x direction (integer value)
  sy | - number of subdivisions in y direction (integer value)
  sz | - number of subdivisions in z direction (integer value)
  pVal | - returns full name of created object

HRESULT IRiSpaceCommand::NURBSSphere | ( | [in] VARIANT | radius,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates NURBS Sphere. Parameters:
  radius | – radius of the shere
  pVal | - returns full name of created object

HRESULT IRiSpaceCommand::NURBSTorus | ( | [in] VARIANT | radius1,
|  | [in] VARIANT | radius2,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates NURBS Torus. Parameters:
  radius1 | – radius of inner ring for the torus
  radius2 | – radius of outer ring for the torus
  pVal | - returns full name of created object

HRESULT IRiSpaceCommand::NURBSCone | ( | [in] VARIANT | radius1,
|  | [in] VARIANT | radius2,
|  | [in] VARIANT | height,
|  | [out, retval] BSTR * | pVal
| ) |

  | Creates NURBS Cone. Parameters:
  radius1 | – radius of top of the cone
  radius2 | – radius of bottom of the cone
  height | – height of the cone
  pVal | - returns full name of created object

HRESULT IRiSpaceCommand::AdjustMatManager | ( | [in] BSTR | bstrObjName,
|  | [in] RtDWORD | dwNumCons
| ) |

  | Adjusts number of input material chunks for given material list or chunk manager object Parameters:
  bstrObjName | – full name of material list or chunk manager object
  dwNumCons | - new number of input connectors for manager object

HRESULT IRiSpaceCommand::SaveScene | ( | [in] BSTR | bszSceneFileName | ) |

  | Saves scene to file. Can be reloaded with the LoadScene method Parameters:
  bszSceneFileName | – filename

HRESULT IRiSpaceCommand::LoadScene | ( | [in] BSTR | bszSceneFileName | ) |

  | Loads scene from file, created previously with the SaveScene method Parameters:
  bszSceneFileName | – filename

HRESULT IRiSpaceCommand::RemEulerTrans | ( | [in] BSTR | bstrName | ) |

  | Replaces EulerTransform object by Transform object for specified object and its sub-objects. All the existing values and connections are maintained. Parameters:
  bstrName | – full name of object to be transformed (if none, selected object will be used)

HRESULT IRiSpaceCommand::ConvertToMatList | ( | [in] BSTR | bstrEncapsName,
|  | [in] BSTR | bstrActiveClass
| ) |

  | Converts object with single DX material to material list. Also allows to specify active class info for the Bridge Parameters:
  bstrEncapsName | – full name of object to be converted (also all subobjects will be processed)
  bstrActiveClass | - GUID of active class to be set (to force material origin, either DX or LW)
Example: use this command to transform all objects on the scene to material lists and sets DX material as a original (so the Bridge will convert all materials when switching to Modeler. This can sometimes fix corrupted Modeler materials
     Space.ConvertToMatList('/Project/Space 3D','{328915F2-9B2F-43c1-9168-CBA26A9B8F43}')

HRESULT IRiSpaceCommand::AutoRunActivities | ( |  | ) |

| Activities on the scene will be automatically run on the scene load (usefull for truePlay).

HRESULT IRiSpaceCommand::LoadRsScnFile | ( | [in] BSTR | bszFileName | ) |

  | Loads scene from .RsScn file (the same format like scene libraries export/import uses) Parameters:
  bszSceneFileName | – filename

HRESULT IRiSpaceCommand::EnableCollision | ( | [in] BSTR | bstrObjName,
|  | [in] BOOL | bEnable
| ) |

  | Enables / disables physical collisions for object. Parameters:
  bstrObjName | – full name of object (if none, selected will be used)
  bEnable | – TRUE for enabling collisions, FALSE for disabling collisions

HRESULT IRiSpaceCommand::NodeMatrixElement | ( | [in] BSTR | szNodeName,
|  | [in] BSTR | szElemName,
|  | [out, retval] VARIANT * | pVal
| ) |

  | Gets transform matrix element for given object. It works properly for objects with Transform subobject, Expanded Matrix or Euler Transform as well. Parameters:
  szNodeName | – full name of object
  szElemName | – transform element name (e.g. 'sx', 'tx', 'roll')
  pVal | – returned value of given transform element

HRESULT IRiSpaceCommand::NodeMatrixElement | ( | [in] BSTR | szNodeName,
|  | [in] BSTR | szElemName,
|  | [in] VARIANT | newVal
| ) |

  | Sets transform matrix element for given object. It works properly for objects with Transform subobject, Expanded Matrix or Euler Transform as well. Parameters:
  szNodeName | – full name of object
  szElemName | – transform element name (e.g. 'sx', 'tx', 'roll')
  newVal | – value of transform elem to be set
Example: use this command to set x position of object to 0, while keeping all others position/scale/rotation params untouched
     Space.NodeMatrixElement('/Project/Space 3D/Cube', 'tx') = 0.0