Clarisse 4.0 SP3 SDK  4.0.0.0.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Static Public Member Functions | List of all members
IOHelpers Class Reference

This static class defines SDK/Script IO function helpers. More...

Inheritance diagram for IOHelpers:
CoreBaseType

Public Types

enum  EditPropertyMode {
  EDIT_PROPERTY_MODE_SET,
  EDIT_PROPERTY_MODE_ADD,
  EDIT_PROPERTY_MODE_MUL,
  EDIT_PROPERTY_MODE_CLEAR,
  EDIT_PROPERTY_MODE_DEFAULT,
  EDIT_PROPERTY_MODE_MUL_QUAT,
  EDIT_PROPERTY_MODE_COUNT
}
 

Static Public Member Functions

static OfObjectcreate_particles (AppObject &app, const CoreString &name, const CoreBasicArray< GMathVec3f > &positions, const CoreBasicArray< GMathVec3f > &normals=CoreBasicArray< GMathVec3f >(0, 0), const CoreBasicArray< GMathVec3f > &velocities=CoreBasicArray< GMathVec3f >(0, 0))
 Create a particle container from the specified arguments.
 
static bool set_particles (OfObject &object, const CoreBasicArray< GMathVec3f > &positions, const CoreBasicArray< GMathVec3f > &normals=CoreBasicArray< GMathVec3f >(0, 0), const CoreBasicArray< GMathVec3f > &velocities=CoreBasicArray< GMathVec3f >(0, 0))
 Set a particle container from the specified arguments.
 
static bool set_particles_properties (OfObject &object, const CoreBasicArray< ResourceProperty * > &properties)
 Set properties for a particle geometry from the specified arguments.
 
static bool set_particles_properties (OfObject &object, const CoreBasicArray< GeometryPointProperty * > &properties)
 Set properties for a particle geometry from the specified arguments.
 
static bool decimate_particles (OfObject &object, const CoreSet< unsigned long > &indices)
 Decimate a particle container from the specified arguments. Update properties accordingly.
 
static bool move_particles_relative (OfObject &object, const CoreSet< unsigned long > &indices, const GMathVec3f &delta, unsigned short space)
 Move some particles within a particle container from the specified arguments.
 
static bool move_particles_absolute (OfObject &object, const CoreBasicArray< unsigned long > &indices, const CoreBasicArray< GMathVec3f > &positions)
 Set position of some particles within a particle container from the specified arguments.
 
static bool add_particles (OfObject &object, const CoreBasicArray< GMathVec3f > &positions, const CoreBasicArray< GMathVec3f > &normals=CoreBasicArray< GMathVec3f >(0, 0), const CoreBasicArray< GMathVec3f > &velocities=CoreBasicArray< GMathVec3f >(0, 0), const CoreBasicArray< GeometryPointProperty * > &properties=CoreBasicArray< GeometryPointProperty * >(0, 0))
 Grow a particle container from the specified arguments. Update properties accordingly.
 
static bool edit_particles_property (OfObject &object, const CoreString &property, const CoreSet< unsigned long > &indices, EditPropertyMode mode, const CoreString &value)
 Edit property of some particles within a particle container from the specified arguments.
 
static bool set_particles_property_values (OfObject &object, const CoreString &property, unsigned int type, unsigned int dim, const CoreSet< unsigned long > &indices, void *values)
 Edit property of some particles within a particle geometry from the specified arguments.
 
static bool create_particles_property (OfObject &object, const CoreString &property, unsigned int type, unsigned int dim, const CoreString &value)
 Add property to all particles within a particle geometry from the specified arguments.
 
static bool rename_particles_property (OfObject &object, const CoreString &property, const CoreString &name)
 Rename a property within a particle geometry.
 
static bool delete_particles_properties (OfObject &object, const CoreVector< CoreString > &properties)
 Remove some properties from a particle geometry.
 
static CoreString get_particles_property (OfObject &object, const CoreString &property_name, unsigned int index)
 Get information about a property from a particle geometry.
 
static OfObjectcreate_polymesh (AppObject &app, const CoreString &name, const CoreBasicArray< GMathVec3f > &vertices, const CoreBasicArray< unsigned int > &faces_vertex_count, const CoreBasicArray< unsigned int > &faces_definition, const CoreBasicArray< CoreString > &shading_groups, const CoreBasicArray< unsigned int > &sg_face_association)
 Create a polymesh from the specified arguments.
 
static bool save_image (AppObject &app, const ImageCanvas &image, const CoreString &filename, const ImageIOFileFormat::Save &format, const CoreString &color_space, const ImageIOFileFormat::OpenExrCompressionMethod &compression_method=ImageIOFileFormat::NO_COMPRESSION)
 Save the specified image with the specified format at the specified extension.
 
static bool import_geometry (AppObject &app, const CoreString &filename, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filename.
 
static bool import_geometries (AppObject &app, const CoreBasicArray< CoreString > &filenames, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filenames.
 
static bool import_geometry (AppObject &app, const CoreString &filename, CoreVector< OfObject * > &geometries, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filename.
 
static bool import_geometries (AppObject &app, const CoreBasicArray< CoreString > &filenames, CoreVector< OfObject * > &geometries, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filenames.
 
static bool import_geometry (OfContext &context, const CoreString &filename, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filename.
 
static bool import_geometries (OfContext &context, const CoreBasicArray< CoreString > &filenames, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filename.
 
static bool import_geometry (OfContext &context, const CoreString &filename, CoreVector< OfObject * > &geometries, const int &import_mats_mode=0, const bool &display_info=true)
 Import one or multiple geometries from the specified filename.
 
static bool import_geometries (OfContext &working_context, const CoreBasicArray< CoreString > &filenames, CoreVector< OfObject * > &geometries, const int &import_mats_mode=0, const bool &display_infos=true)
 Import one or multiple geometries from the specified filename.
 
static bool export_geometry (AppObject &app, const CoreString &filename, const CoreVector< OfObject * > &geometries)
 Export one or multiple geometries to the specified filename.
 
static OfContextimport_volume (AppObject &app, const CoreString &filename)
 Import a volume from the specified filename.
 
static OfContextimport_volume (OfContext &context, const CoreString &filename)
 Import a volume from the specified filename.
 
static OfContextimport_volumes (AppObject &app, const CoreBasicArray< CoreString > &filenames)
 Import one or multiple volumes from the specified filename.
 
static OfContextimport_volumes (OfContext &context, const CoreBasicArray< CoreString > &filenames)
 Import one or multiple volumes from the specified filename.
 
static bool import_image (AppObject &app, const CoreString &filename, OfObject *image)
 Import one image from the specified filename.
 
static bool import_images (AppObject &app, const CoreBasicArray< CoreString > &filenames, CoreVector< OfObject * > &images)
 Import one or multiple images from the specified filename.
 
static bool import_image (OfContext &context, const CoreString &filename, OfObject *image)
 Import one image from the specified filename.
 
static bool import_images (OfContext &context, const CoreBasicArray< CoreString > &filenames, CoreVector< OfObject * > &images)
 Import one or multiple images from the specified filename.
 
static bool import_texture (AppObject &app, const CoreString &filename, const CoreString &class_name, const CoreString &suffix, OfObject *texture)
 Import one texture from the specified filename.
 
static bool import_textures (AppObject &app, const CoreBasicArray< CoreString > &filenames, const CoreString &class_name, const CoreString &suffix, CoreVector< OfObject * > &textures)
 Import one or multiple textures from the specified filename.
 
static bool import_texture (OfContext &context, const CoreString &filename, const CoreString &class_name, const CoreString &suffix, OfObject *texture)
 Import one texture from the specified filename.
 
static bool import_textures (OfContext &context, const CoreBasicArray< CoreString > &filenames, const CoreString &class_name, const CoreString &suffix, CoreVector< OfObject * > &textures)
 Import one or multiple textures from the specified filename.
 
static bool export_render_archive (AppObject &app, const CoreString &filename)
 Export the current project to the specified render archive filename.
 
static bool export_context_as_project (AppObject &app, const OfContext &context, const CoreString &filename)
 Export a context to the specified project filename.
 
static bool export_context_as_project_with_dependencies (AppObject &app, const OfContext &context, const CoreString &filename)
 Export a context to the specified project filename, including its dependencies.
 
static bool reference_export_context (AppObject &app, OfContext &context, const CoreString &filename)
 Export a context to the specified project filename.
 
static void reload_resources (AppObject &app)
 Reload resources (Force the synchronization of resources)
 
static void resync_resources (AppObject &app)
 Resynchronize resources.
 
static OfContextimport_scene (AppObject &app, const CoreString &filename, AppProgressBar *load_progress_bar=nullptr)
 
static OfContextimport_scene (OfContext &context, const CoreString &filename, AppProgressBar *load_progress_bar=nullptr)
 
static bool import_scene (OfContext &import_context, const CoreString &filename, CoreVector< OfObject * > &imported_objects)
 
static OfContextimport_project (AppObject &app, const CoreString &filename)
 Import a project from the specified filename.
 
static OfContextimport_project (OfContext &context, const CoreString &filename)
 Import a project from the specified filename.
 
static OfContextreference_asset (AppObject &app, const CoreString &filename)
 Reference an asset from the specified filename.
 
static OfContextreference_asset (OfContext &context, const CoreString &filename)
 Reference an asset from the specified filename.
 
static bool reference_file (OfContext &working_context, const CoreBasicArray< CoreString > &filenames)
 Reference files from the specified filenames.
 
static OfContextreference_file (OfContext &working_context, const CoreString &filename)
 Reference a file from the specified filename.
 
static bool reference_files (OfContext &working_context, const CoreBasicArray< CoreString > &filenames, CoreVector< OfContext * > &refs)
 Reference files from the specified filenames.
 
static void reference_make_local (AppObject &app, OfContext &context)
 Make local the specified reference.
 
static void reference_make_local (AppObject &app, const CoreBasicArray< CoreString > &context_paths)
 Make local the specified reference paths.
 
static bool export_to_alembic (AbcExportOptions &options)
 Exports objects to an alembic Archive.
 
static void save_icon (OfClass &cls, const CoreString &filename, const int &size=128)
 Export a class internal icon to an output image file.
 
static void extract_shading_layer (OfObject &result_sl, OfObject &group, OfObject &shading_layer)
 Extract a new shading layer from an input shading layer and a group of scene objects.
 
static void extract_shading_layer (OfObject &result_sl, OfObject &object)
 Extract a new shading layer from an input layer 3d by creating absolute rules.
 
static OfItempick_item (GuiApp &app, const CoreBasicArray< CoreString > &filter_classes, const CoreString &title="")
 Popup the browser picker and return the selected OfItem.
 
static OfItempick_item (GuiApp &app, const CoreBasicArray< CoreString > &filter_classes, const OfContext &path, const CoreString &title="")
 Popup the browser picker and return the selected OfItem.
 
static void pick_items (GuiApp &app, CoreVector< OfItem * > &selection, const CoreBasicArray< CoreString > &filter_classes, const CoreString &title="")
 Popup the browser picker and return the selected OfItem items.
 
static void pick_items (GuiApp &app, CoreVector< OfItem * > &selection, const CoreBasicArray< CoreString > &filter_classes, const OfContext &path, const CoreString &title="")
 Popup the browser picker and return the selected OfItem items.
 
static OfObjectpick_object (GuiApp &app, const CoreBasicArray< CoreString > &filter_classes, const CoreString &title="")
 Popup the browser picker and return the selected OfObject.
 
static OfObjectpick_object (GuiApp &app, const CoreBasicArray< CoreString > &filter_classes, const OfContext &path, const CoreString &title="")
 Popup the browser picker and return the selected OfObject.
 
static void pick_objects (GuiApp &app, CoreVector< OfObject * > &selection, const CoreBasicArray< CoreString > &filter_classes, const CoreString &title="")
 Popup the browser picker and return the selected OfObject items.
 
static void pick_objects (GuiApp &app, CoreVector< OfObject * > &selection, const CoreBasicArray< CoreString > &filter_classes, const OfContext &path, const CoreString &title="")
 Popup the browser picker and return the selected OfObject items.
 
static OfContextpick_context (GuiApp &app, const CoreString &title="")
 Popup the browser picker and return the selected OfContext.
 
static OfContextpick_context (GuiApp &app, const OfContext &path, const CoreString &title="")
 Popup the browser picker and return the selected OfContext.
 
static void pick_contexts (GuiApp &app, CoreVector< OfContext * > &selection, const CoreString &title="")
 Popup the browser picker and return the selected OfContext items.
 
static void pick_contexts (GuiApp &app, CoreVector< OfContext * > &selection, const OfContext &path, const CoreString &title="")
 Popup the browser picker and return the selected OfContext items.
 
- Static Public Member Functions inherited from CoreBaseType
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
static const CoreClassInfoclass_info ()
 

Additional Inherited Members

- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Detailed Description

This static class defines SDK/Script IO function helpers.

Member Function Documentation

bool IOHelpers::add_particles ( OfObject object,
const CoreBasicArray< GMathVec3f > &  positions,
const CoreBasicArray< GMathVec3f > &  normals = CoreBasicArray<GMathVec3f>(0, 0),
const CoreBasicArray< GMathVec3f > &  velocities = CoreBasicArray<GMathVec3f>(0, 0),
const CoreBasicArray< GeometryPointProperty * > &  properties = CoreBasicArray<GeometryPointProperty *>(0, 0) 
)
static

Grow a particle container from the specified arguments. Update properties accordingly.

Parameters
[in]objectParticle container
[in]positionsArray of positions
[in]normalsArray of normals
[in]velocitiesArray of velocities
[in]propertiesArray of properties to merge
Returns
True if successful
OfObject * IOHelpers::create_particles ( AppObject app,
const CoreString name,
const CoreBasicArray< GMathVec3f > &  positions,
const CoreBasicArray< GMathVec3f > &  normals = CoreBasicArray<GMathVec3f>(0, 0),
const CoreBasicArray< GMathVec3f > &  velocities = CoreBasicArray<GMathVec3f>(0, 0) 
)
static

Create a particle container from the specified arguments.

Parameters
[in]appApplication object
[in]nameParticle container name
[in]positionsArray of positions
[in]normalsArray of normals
[in]velocitiesArray of velocities
Returns
Created OfObject if successful, Null otherwise
bool IOHelpers::create_particles_property ( OfObject object,
const CoreString property,
unsigned int  type,
unsigned int  dim,
const CoreString value 
)
static

Add property to all particles within a particle geometry from the specified arguments.

Note
Fully supported only on GeometryParticleContainer (on other classes, the modification may be lost upon reload).
Parameters
[in]objectParticle geometry
[in]propertyName of the property to create
[in]typeType of value as ResourceProperty::Type
[in]dimNumber of subvalues
[in]valueActual value depends on property definition (type & dim). Several subvalues have to be separated by ' '.
Returns
True if successful
OfObject * IOHelpers::create_polymesh ( AppObject app,
const CoreString name,
const CoreBasicArray< GMathVec3f > &  vertices,
const CoreBasicArray< unsigned int > &  faces_vertex_count,
const CoreBasicArray< unsigned int > &  faces_definition,
const CoreBasicArray< CoreString > &  shading_groups,
const CoreBasicArray< unsigned int > &  sg_face_association 
)
static

Create a polymesh from the specified arguments.

Parameters
[in]appApplication object
[in]namePolymesh name
[in]verticesArray of vertices
[in]faces_vertex_countArray of number of vertices defining each face (3 for a triangle, 4 for a quad...)
[in]faces_definitionArray of vertex id defining each faces
[in]shading_groupsArray of shading group names
[in]sg_face_associationPer face shading group association
Returns
Created OfObject if successful, Null otherwise
bool IOHelpers::decimate_particles ( OfObject object,
const CoreSet< unsigned long > &  indices 
)
static

Decimate a particle container from the specified arguments. Update properties accordingly.

Parameters
[in]objectParticle container
[in]indicesSet of particle indices to remove
Returns
True if successful
bool IOHelpers::delete_particles_properties ( OfObject object,
const CoreVector< CoreString > &  properties 
)
static

Remove some properties from a particle geometry.

Note
Fully supported only on GeometryParticleContainer (on other classes, the modification may be lost upon reload).
Parameters
[in]objectParticle geometry
[in]propertiesNames of properties to remove
Returns
True if successful
bool IOHelpers::edit_particles_property ( OfObject object,
const CoreString property,
const CoreSet< unsigned long > &  indices,
EditPropertyMode  mode,
const CoreString value 
)
static

Edit property of some particles within a particle container from the specified arguments.

Parameters
[in]objectParticle container
[in]propertyName of the property to edit
[in]indicesArray of indices to edit. Empty array is a shortcut to edit all values
[in]modeEdit mode
[in]valueActual value depends on property definition (type & extent). After conversion, it is used to modify current value according to edit mode Number of subvalues must be either 1 (uniform) or match the property extent.
Returns
True if successful
bool IOHelpers::export_context_as_project ( AppObject app,
const OfContext context,
const CoreString filename 
)
static

Export a context to the specified project filename.

Parameters
[in]appApplication object
[in]contextContext
[in]filenameproject filename
Returns
True if successful
bool IOHelpers::export_context_as_project_with_dependencies ( AppObject app,
const OfContext context,
const CoreString filename 
)
static

Export a context to the specified project filename, including its dependencies.

Parameters
[in]appApplication object
[in]contextContext
[in]filenameproject filename
Returns
True if successful
bool IOHelpers::export_geometry ( AppObject app,
const CoreString filename,
const CoreVector< OfObject * > &  geometries 
)
static

Export one or multiple geometries to the specified filename.

Parameters
[in]appApplication object
[in]filenameGeometry filename
[out]geometriesOfObject geometries to export
Note
Geometries will be merged
Returns
True if successful
bool IOHelpers::export_render_archive ( AppObject app,
const CoreString filename 
)
static

Export the current project to the specified render archive filename.

Parameters
[in]appApplication object
[in]filenameImage filename
Note
This method is only available if called inside a Clarisse session. For example, it can be used in a shelf script that would first create an archive before sending it to the farm.
Returns
True if successful
bool IOHelpers::export_to_alembic ( AbcExportOptions &  options)
static

Exports objects to an alembic Archive.

Parameters
[in]Exportoptions, including asset filename, animation range, etc...
Returns
True if the export succeeded, False if any error occurred.
void IOHelpers::extract_shading_layer ( OfObject result_sl,
OfObject group,
OfObject shading_layer 
)
static

Extract a new shading layer from an input shading layer and a group of scene objects.

Parameters
[in]result_slresulting shading layer
[in]groupgroup defining a list of scene objects
[in]shading_layershading layer defining rule overrides applied to scene objects
[in]namename of the output shading layer
void IOHelpers::extract_shading_layer ( OfObject result_sl,
OfObject object 
)
static

Extract a new shading layer from an input layer 3d by creating absolute rules.

Parameters
[in]result_slresulting shading layer
[in]objectinput 3D layer or in group defining a list of scene objects
[in]nameName of the output shading layer
CoreString IOHelpers::get_particles_property ( OfObject object,
const CoreString property_name,
unsigned int  index 
)
static

Get information about a property from a particle geometry.

Parameters
[in]objectParticle geometry
[in]property_nameName of property
[in]indexindex of the particle
Returns
particle property value
bool IOHelpers::import_geometries ( AppObject app,
const CoreBasicArray< CoreString > &  filenames,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filenames.

Parameters
[in]appApplication object
[in]filenamesGeometry filenames
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if success
bool IOHelpers::import_geometries ( AppObject app,
const CoreBasicArray< CoreString > &  filenames,
CoreVector< OfObject * > &  geometries,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filenames.

Parameters
[in]appApplication object
[in]filenamesGeometry filenames
[out]geometriesOfObject geometries that were created after import
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if successful
bool IOHelpers::import_geometries ( OfContext context,
const CoreBasicArray< CoreString > &  filenames,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filename.

Parameters
[in]contextContext that will contain the imported geometries
[in]filenamesGeometry filenames
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if success
bool IOHelpers::import_geometries ( OfContext working_context,
const CoreBasicArray< CoreString > &  filenames,
CoreVector< OfObject * > &  geometries,
const int &  import_mats_mode = 0,
const bool &  display_infos = true 
)
static

Import one or multiple geometries from the specified filename.

Parameters
[in]contextContext that will contain the imported geometries
[in]filenamesGeometry filenames
[out]geometriesOfObject geometries that were created after import
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if successful
bool IOHelpers::import_geometry ( AppObject app,
const CoreString filename,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filename.

Parameters
[in]appApplication object
[in]filenameGeometry filename
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if success
bool IOHelpers::import_geometry ( AppObject app,
const CoreString filename,
CoreVector< OfObject * > &  geometries,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filename.

Parameters
[in]appApplication object
[in]filenameGeometry filename
[out]geometriesOfObject geometries that were created after import
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if successful
bool IOHelpers::import_geometry ( OfContext context,
const CoreString filename,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filename.

Parameters
[in]contextContext that will contain the imported geometries
[in]filenameGeometry filename
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if success
bool IOHelpers::import_geometry ( OfContext context,
const CoreString filename,
CoreVector< OfObject * > &  geometries,
const int &  import_mats_mode = 0,
const bool &  display_info = true 
)
static

Import one or multiple geometries from the specified filename.

Parameters
[in]contextContext that will contain the imported geometries
[in]filenameGeometry filename
[out]geometriesOfObject geometries that were created after import
[in]import_mats_modeSpecify the import mode for the materials (only .obj) -1:no import, 0:ask, 1:import
[in]display_infosEnable or disable the display informations (enable by default)
Note
Depending on the file format, multiple geometries can be created from a single filename
Returns
True if successful
bool IOHelpers::import_image ( AppObject app,
const CoreString filename,
OfObject image 
)
static

Import one image from the specified filename.

Parameters
[in]appApplication object
[in]filenameImage filename
[out]imageOfObject image is that was created after import
Returns
True if successful
bool IOHelpers::import_image ( OfContext context,
const CoreString filename,
OfObject image 
)
static

Import one image from the specified filename.

Parameters
[in]contextContext that will contain the imported images
[in]filenameImage filename
[out]imagesOfObject image is that was created after import
Returns
True if successful
bool IOHelpers::import_images ( AppObject app,
const CoreBasicArray< CoreString > &  filenames,
CoreVector< OfObject * > &  images 
)
static

Import one or multiple images from the specified filename.

Parameters
[in]appApplication object
[in]filenamesImage filenames
[out]imagesOfObject images is that were created after import
Returns
True if successful
bool IOHelpers::import_images ( OfContext context,
const CoreBasicArray< CoreString > &  filenames,
CoreVector< OfObject * > &  images 
)
static

Import one or multiple images from the specified filename.

Parameters
[in]contextContext that will contain the imported images
[in]filenamesImage filenames
[out]imagesOfObject images is that were created after import
Returns
True if successful
OfContext * IOHelpers::import_project ( AppObject app,
const CoreString filename 
)
static

Import a project from the specified filename.

Parameters
[in]appApplication object
[in]filenameProject filename
Note
Project defined variables are automatically appended to the variables defined in the current project
Returns
The created context containing the project
OfContext * IOHelpers::import_project ( OfContext context,
const CoreString filename 
)
static

Import a project from the specified filename.

Parameters
[in]working_contextContext that will contain the imported scene
[in]filenameProject filename
Note
project defined variables are automatically appended to the variables defined in the current project
Returns
The created context containing the project
OfContext * IOHelpers::import_scene ( AppObject app,
const CoreString filename,
AppProgressBar load_progress_bar = nullptr 
)
static

Import a scene from the specified filename.

Parameters
appApplication object.
filenameScene filename.
load_progress_barOptional global progress bar.
Returns
The created context containing the scene.
OfContext * IOHelpers::import_scene ( OfContext context,
const CoreString filename,
AppProgressBar load_progress_bar = nullptr 
)
static

Import a scene from the specified filename.

Parameters
contextContext that will contain the imported scene.
filenameScene filename.
load_progress_barOptional global progress bar.
Returns
The created context containing the scene.
bool IOHelpers::import_scene ( OfContext import_context,
const CoreString filename,
CoreVector< OfObject * > &  imported_objects 
)
static

Imports the items of a scene into the specified context.

Contrary to the other import_scene functions, this function does not create a new context containing the created items. Created items can be accessed via the specified vector.

Parameters
import_contextContext in which the scene items will be created.
filenameScene filename.
imported_objectsObjects that have been created into the import context when importing the scene.
Returns
True if the scene file was successfully imported.
bool IOHelpers::import_texture ( AppObject app,
const CoreString filename,
const CoreString class_name,
const CoreString suffix,
OfObject texture 
)
static

Import one texture from the specified filename.

Parameters
[in]appApplication object
[in]filenameImage filename
[out]textureOfObject texture is that were created after import
Returns
True if successful
bool IOHelpers::import_texture ( OfContext context,
const CoreString filename,
const CoreString class_name,
const CoreString suffix,
OfObject texture 
)
static

Import one texture from the specified filename.

Parameters
[in]contextContext that will contain the imported texture
[in]filenameImage filename
[out]textureOfObject texture is that were created after import
Returns
True if successful
bool IOHelpers::import_textures ( AppObject app,
const CoreBasicArray< CoreString > &  filenames,
const CoreString class_name,
const CoreString suffix,
CoreVector< OfObject * > &  textures 
)
static

Import one or multiple textures from the specified filename.

Parameters
[in]appApplication object
[in]filenamesImage filenames
[out]texturesOfObject textures is that were created after import
Returns
True if successful
bool IOHelpers::import_textures ( OfContext context,
const CoreBasicArray< CoreString > &  filenames,
const CoreString class_name,
const CoreString suffix,
CoreVector< OfObject * > &  textures 
)
static

Import one or multiple textures from the specified filename.

Parameters
[in]contextContext that will contain the imported textures
[in]filenamesImage filenames
[out]texturesOfObject textures is that were created after import
Returns
True if successful
OfContext * IOHelpers::import_volume ( AppObject app,
const CoreString filename 
)
static

Import a volume from the specified filename.

Parameters
[in]appApplication object
[in]filenameVolume filename
Returns
The created context containing the volume
OfContext * IOHelpers::import_volume ( OfContext context,
const CoreString filename 
)
static

Import a volume from the specified filename.

Parameters
[in]contextContext that will contain the imported volume
[in]filenameVolume filename
Returns
The created context containing the volume
OfContext * IOHelpers::import_volumes ( AppObject app,
const CoreBasicArray< CoreString > &  filenames 
)
static

Import one or multiple volumes from the specified filename.

Parameters
[in]appApplication object
[in]filenamesVolume filenames
Returns
The created context containing the volume
OfContext * IOHelpers::import_volumes ( OfContext context,
const CoreBasicArray< CoreString > &  filenames 
)
static

Import one or multiple volumes from the specified filename.

Parameters
[in]contextContext that will contain the imported volume
[in]filenamesVolume filenames
Returns
The created context containing the volume
bool IOHelpers::move_particles_absolute ( OfObject object,
const CoreBasicArray< unsigned long > &  indices,
const CoreBasicArray< GMathVec3f > &  positions 
)
static

Set position of some particles within a particle container from the specified arguments.

Parameters
[in]objectParticle container
[in]indicesArray of particle indices to set
[in]positionsArray of positions
Returns
True if successful
bool IOHelpers::move_particles_relative ( OfObject object,
const CoreSet< unsigned long > &  indices,
const GMathVec3f &  delta,
unsigned short  space 
)
static

Move some particles within a particle container from the specified arguments.

Parameters
[in]objectParticle container
[in]indicesSet of particle indices to move
[in]deltavalue to add in given space
[in]spacespace (world,object,local) in which value is expressed
Returns
True if successful
OfContext * IOHelpers::pick_context ( GuiApp app,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfContext.

Parameters
[in]appapplication
[in]titleset the title bar of the browser window
OfContext * IOHelpers::pick_context ( GuiApp app,
const OfContext path,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfContext.

Parameters
[in]appapplication
[in]pathset the context for which the browser should display its content
[in]titleset the title bar of the browser window
void IOHelpers::pick_contexts ( GuiApp app,
CoreVector< OfContext * > &  selection,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfContext items.

Parameters
[in]appapplication
[out]selectionresulting user selection
[in]titleset the title bar of the browser window
void IOHelpers::pick_contexts ( GuiApp app,
CoreVector< OfContext * > &  selection,
const OfContext path,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfContext items.

Parameters
[in]appapplication
[out]selectionresulting user selection
[in]pathset the context for which the browser should display its content
[in]titleset the title bar of the browser window
OfItem * IOHelpers::pick_item ( GuiApp app,
const CoreBasicArray< CoreString > &  filter_classes,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfItem.

Parameters
[in]appapplication
[in]filter_classesthe browser displays only items matching the specified classes
[in]titleset the title bar of the browser window
OfItem * IOHelpers::pick_item ( GuiApp app,
const CoreBasicArray< CoreString > &  filter_classes,
const OfContext path,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfItem.

Parameters
[in]appapplication
[in]filter_classesthe browser displays only items matching the specified classes
[in]pathset the context for which the browser should display its content
[in]titleset the title bar of the browser window
void IOHelpers::pick_items ( GuiApp app,
CoreVector< OfItem * > &  selection,
const CoreBasicArray< CoreString > &  filter_classes,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfItem items.

Parameters
[in]appapplication
[out]selectionresulting user selection
[in]filter_classesthe browser displays only items matching the specified classes
[in]titleset the title bar of the browser window
void IOHelpers::pick_items ( GuiApp app,
CoreVector< OfItem * > &  selection,
const CoreBasicArray< CoreString > &  filter_classes,
const OfContext path,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfItem items.

Parameters
[in]appapplication
[out]selectionresulting user selection
[in]filter_classesthe browser displays only items matching the specified classes
[in]pathset the context for which the browser should display its content
[in]titleset the title bar of the browser window
OfObject * IOHelpers::pick_object ( GuiApp app,
const CoreBasicArray< CoreString > &  filter_classes,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfObject.

Parameters
[in]appapplication
[in]filter_classesthe browser displays only items matching the specified classes
[in]titleset the title bar of the browser window
OfObject * IOHelpers::pick_object ( GuiApp app,
const CoreBasicArray< CoreString > &  filter_classes,
const OfContext path,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfObject.

Parameters
[in]appapplication
[in]filter_classesthe browser displays only items matching the specified classes
[in]pathset the context for which the browser should display its content
[in]titleset the title bar of the browser window
void IOHelpers::pick_objects ( GuiApp app,
CoreVector< OfObject * > &  selection,
const CoreBasicArray< CoreString > &  filter_classes,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfObject items.

Parameters
[in]appapplication
[out]selectionresulting user selection
[in]filter_classesthe browser displays only items matching the specified classes
[in]titleset the title bar of the browser window
void IOHelpers::pick_objects ( GuiApp app,
CoreVector< OfObject * > &  selection,
const CoreBasicArray< CoreString > &  filter_classes,
const OfContext path,
const CoreString title = "" 
)
static

Popup the browser picker and return the selected OfObject items.

Parameters
[in]appapplication
[out]selectionresulting user selection
[in]filter_classesthe browser displays only items matching the specified classes
[in]pathset the context for which the browser should display its content
[in]titleset the title bar of the browser window
OfContext * IOHelpers::reference_asset ( AppObject app,
const CoreString filename 
)
static

Reference an asset from the specified filename.

Parameters
[in]appApplication object
[in]filenameAsset filename
Returns
The created context containing the asset
Note
Deprecated and not undoable, use reference_file instead
OfContext * IOHelpers::reference_asset ( OfContext context,
const CoreString filename 
)
static

Reference an asset from the specified filename.

Parameters
[in]working_contextContext that will contain the imported asset
[in]filenameAsset filename
Returns
The created context containing the asset
Note
Deprecated and not undoable, use reference_file instead
bool IOHelpers::reference_export_context ( AppObject app,
OfContext context,
const CoreString filename 
)
static

Export a context to the specified project filename.

Parameters
[in]appApplication object
[in]contextContext
[in]filenamesproject filename
Returns
True if successful
bool IOHelpers::reference_file ( OfContext working_context,
const CoreBasicArray< CoreString > &  filenames 
)
static

Reference files from the specified filenames.

Parameters
[in]working_contextContext that will contain the referenced assets
[in]filenamesAsset filenames
Returns
True if successful
Note
Soon deprecated, you may use reference_files instead, which returns the contexts that have been created
OfContext * IOHelpers::reference_file ( OfContext working_context,
const CoreString filename 
)
static

Reference a file from the specified filename.

Parameters
[in]working_contextContext that will contain the referenced asset
[in]filenameAsset filename
Returns
The created reference context containing the file
bool IOHelpers::reference_files ( OfContext working_context,
const CoreBasicArray< CoreString > &  filenames,
CoreVector< OfContext * > &  refs 
)
static

Reference files from the specified filenames.

Parameters
[in]working_contextContext that will contain the referenced assets
[in]filenamesAsset filenames
[out]refsReference contexts that have been created
Returns
True if successful
void IOHelpers::reference_make_local ( AppObject app,
OfContext context 
)
static

Make local the specified reference.

Parameters
[in]appApplication object
[in]contextContext that will become local
void IOHelpers::reference_make_local ( AppObject app,
const CoreBasicArray< CoreString > &  context_paths 
)
static

Make local the specified reference paths.

Parameters
[in]appApplication object
[in]context_pathsContexts that will become local
void IOHelpers::reload_resources ( AppObject app)
static

Reload resources (Force the synchronization of resources)

Parameters
[in]appApplication object
bool IOHelpers::rename_particles_property ( OfObject object,
const CoreString property,
const CoreString name 
)
static

Rename a property within a particle geometry.

Note
Fully supported only on GeometryParticleContainer (on other classes, the modification may be lost upon reload).
Parameters
[in]objectParticle geometry
[in]propertyFormer name of the property
[in]nameNew name of the property
Returns
True if successful
void IOHelpers::resync_resources ( AppObject app)
static

Resynchronize resources.

Parameters
[in]appApplication object
void IOHelpers::save_icon ( OfClass cls,
const CoreString filename,
const int &  size = 128 
)
static

Export a class internal icon to an output image file.

Parameters
[in]clsClass from which to export its icon
[in]filenameOutput image name
[in]sizeImage size in pixel; by default size = 128
bool IOHelpers::save_image ( AppObject app,
const ImageCanvas image,
const CoreString filename,
const ImageIOFileFormat::Save &  format,
const CoreString color_space,
const ImageIOFileFormat::OpenExrCompressionMethod &  compression_method = ImageIOFileFormat::NO_COMPRESSION 
)
static

Save the specified image with the specified format at the specified extension.

Parameters
[in]appApplication object
[in]imageimage to save
[in]filenamefilename
[in]format
[in]color_spaceconvert image to the specified color space
Note
The file extension is automatically appended
Returns
True if successful
bool IOHelpers::set_particles ( OfObject object,
const CoreBasicArray< GMathVec3f > &  positions,
const CoreBasicArray< GMathVec3f > &  normals = CoreBasicArray<GMathVec3f>(0, 0),
const CoreBasicArray< GMathVec3f > &  velocities = CoreBasicArray<GMathVec3f>(0, 0) 
)
static

Set a particle container from the specified arguments.

Parameters
[in]objectParticle container
[in]positionsArray of positions
[in]normalsArray of normals
[in]velocitiesArray of velocities
Returns
True if successful
bool IOHelpers::set_particles_properties ( OfObject object,
const CoreBasicArray< ResourceProperty * > &  properties 
)
static

Set properties for a particle geometry from the specified arguments.

Note
Fully supported only on GeometryParticleContainer (on other classes, the modification may be lost upon reload).
Parameters
[in]objectParticle geometry
[in]propertiesArray of properties
Returns
True if successful
bool IOHelpers::set_particles_properties ( OfObject object,
const CoreBasicArray< GeometryPointProperty * > &  properties 
)
static

Set properties for a particle geometry from the specified arguments.

Note
Fully supported only on GeometryParticleContainer (on other classes, the modification may be lost upon reload).
Parameters
[in]objectParticle geometry
[in]propertiesArray of properties
Returns
True if successful
bool IOHelpers::set_particles_property_values ( OfObject object,
const CoreString property,
unsigned int  type,
unsigned int  dim,
const CoreSet< unsigned long > &  indices,
void *  values 
)
static

Edit property of some particles within a particle geometry from the specified arguments.

Note
Fully supported only on GeometryParticleContainer (on other classes, the modification may be lost upon reload).
Parameters
[in]objectParticle geometry
[in]propertyName of the property to edit
[in]typeType of value as ResourceProperty::Type
[in]dimNumber of subvalues
[in]indicesArray of indices to set. Empty array is a shortcut to set all values
[in]valuesbuffer content depends on property definition (type & dim). Assume that the given pointer can be cast to the required type and that the buffer provides enough subvalues.