Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Functions | Variables
clarisse_helper Namespace Reference

This module defines to python Clarisse function helpers. More...

Classes

class  ApplicationSelection
 Clarisse global application selection class wrapper. More...
 

Functions

def load_project
 Load the specified Clarisse project file.
 
def save_project
 Save the current project.
 
def export_render_archive
 Export the current project as render archive.
 
def render_image
 Render the specified image item and return the rendered image.
 
def save_image
 Save the specified image at the specified filename with the specified format and return True if sucessful.
 
def save_exr16
 Save the specified image at the specified filename as a 16-bit (float) EXR.
 
def save_exr32
 Save the specified image at the specified filename as a 32-bit (float) EXR.
 
def save_jpg
 Save the specified image at the specified filename as a JPG.
 
def save_bmp
 Save the specified image at the specified filename as a BMP.
 
def save_tga
 Save the specified image at the specified filename as a TGA.
 
def save_png8
 Save the specified image at the specified filename as a 8-bit PNG.
 
def save_png16
 Save the specified image at the specified filename as a 16-bit PNG.
 
def save_tif8
 Save the specified image at the specified filename as a 8-bit TIF.
 
def save_tif16
 Save the specified image at the specified filename as a 16-bit TIF.
 
def save_tif32
 Save the specified image at the specified filename as a 32-bit TIF.
 
def get_current_frame
 Return the current frame number.
 
def set_current_frame
 Set the current frame number to the specified frame.
 
def import_geometry
 Return a OfObject if the specified geometry has been successfully loaded.
 
def import_geometries
 Return an array of OfObject if the specified geometry has been successfully loaded.
 
def import_image
 Return a OfObject if the specified image has been successfully loaded.
 
def import_images
 Return an array of OfObject if the specified images has been successfully loaded.
 
def import_map_file
 Return a OfObject if the specified image has been successfully loaded.
 
def import_map_files
 Return an array of OfObject if the specified images has been successfully loaded.
 
def import_volume
 Return a OfObject if the specified volume has been successfully loaded.
 
def import_volumes
 Return an array of OfObject if the specified volumes has been successfully loaded.
 
def export_geometry
 Exports the geometry given as parameter.
 
def export_geometries
 Exports the geometry given as parameter.
 
def reference_file
 When a single file is specified, return the OfContext that has been successfully referenced.
 
def reference_files
 Return an array of OfContexts if the specified files have been successfully referenced.
 
def export_context_as_project
 Export a context to the specified project filename.
 
def export_context_as_project_with_dependencies
 Export a context to the specified project filename, including its dependencies.
 
def reference_export_context
 Export a context to the specified project filename, and convert the context to a reference context that refernces the exported project.
 
def reference_make_local
 Make local object from the specified a reference.
 
def import_scene
 Return the created context containing the scene if the specified file has been successfully loaded.
 
def import_project
 Return the created context containing the scene if the specified file has been successfully loaded.
 
def log_info
 Output the specified info message.
 
def log_warning
 Output the specified warning message.
 
def log_error
 Output the specified error message.
 
def is_gui_application
 Return True if the application is running in GUI mode Use this method if you are doing specific GUI actions to check if the application is running in UI mode.
 
def is_process_application
 Return True if the application is running in process mode A process application, is an application which doesn't take input.
 
def is_interactive_application
 Return True if the application is running in interactive mode An interactive application, is an application that behaves like a command-line shell.
 
def set_current_context
 Set the current working context (Global slot)
 
def get_current_context
 Return the current working context (OfContext)
 
def create_object
 Create an object named item_name of the specified class_name inside the current working context.
 
def delete_item
 Delete the specified item (object or context)
 
def is_context_exists
 Return True if the specified context exists.
 
def item_exists
 Return the specified item (OfContext or OfObject) if it exists.
 
def get_item
 Return the item (OfContext or OfObject) from the specified name.
 
def make_absolute_of_path
 Return the specified path as an absolute Clarisse path (containing project://)
 
def inspect
 Display the attributes of the specified item.
 
def create_context
 Create a new context.
 
def create_generic_object
 Create and return a new generic object name after the specified name.
 
def add_attribute
 Add and return a custom attribute to the specified object.
 
def enable_command_history
 Enable command history.
 
def disable_command_history
 Disable command history.
 
def enable_echo_command
 Enable echo command.
 
def disable_echo_command
 Disable echo command.
 
def begin_command_batch
 Start new a command batch by pushing it in the batch stack (batches can be nested)
 
def end_command_batch
 End a command batch by poping it from the batch stack.
 
def check_need_save
 Check if the current project is modified and proposed to save it.
 

Variables

tuple selection ApplicationSelection()
 Global application selection helper.
 

Detailed Description

This module defines to python Clarisse function helpers.

The file is automatically imported directly inside the ix module. To acess to the functions just type for example: ix.render_image('my_image')

Function Documentation

def clarisse_helper.add_attribute (   obj,
  attr_name,
  attr_type,
  category = "General" 
)

Add and return a custom attribute to the specified object.

Parameters
objObject that will get the new attribute
attr_nameNew attribute name
attr_typeString defining the type of the attribute. Following are the possible attribute type values:
  • 'bool' to define a boolean (True/False) value
  • 'long' to define a long value
  • 'double' to define a double floating point value
  • 'reference' to define a reference to an object
  • 'percentage' to define a percentage
  • 'distance' to define a distance
  • 'scale' to define a scale
  • 'angle' to define an angle
  • 'frame' to define a frame
  • 'subframe' to define a subframe
  • 'l' to define a luminance color
  • 'la' to define a luminance + alpha color
  • 'rgb' to define a RGB color
  • 'rgba' to define a RGBA color
  • 'filein' to define a filein value
  • 'fileout' to define a fileout value
  • 'pixel' to define a pixel value
  • 'subpixel' to define a subpixel value (allowing fractional values)
categoryUser category of the attribute.
Returns
The newly created attribute
Note
If the specified attribute name already exists, it will get automatically renamed. Attribute names support only identifier type string: 'my_attribute_name'
def clarisse_helper.begin_command_batch (   batch_name)

Start new a command batch by pushing it in the batch stack (batches can be nested)

Parameters
batch_nameThe name of the command batch that will be displayed in the History Editor
def clarisse_helper.check_need_save ( )

Check if the current project is modified and proposed to save it.

Returns
Return the response of file browser and the filename chosen (Can return a None value for the filename)
def clarisse_helper.create_generic_object (   object_name)

Create and return a new generic object name after the specified name.

Note
A generic object doesn't declare any attribute. You can then use it add your custom attributes on it. For example, it's typical use is to create a temporary generic object, populate it with custom attributes. Then you would use inspect to display its attribute to get user input. Once the data as been retreived the object can be freely deleted.
def clarisse_helper.create_object (   item_name,
  class_name,
  destination_context = None 
)

Create an object named item_name of the specified class_name inside the current working context.

Parameters
item_nameName of the newly created item
class_nameObject class name of the item to create
destination_contextDestination context in which the object is created. By default, objects are created in the current application context
Note
If the specified item_name already exists, the item will be automatically renamed.
Returns
Return the new item (OfObject) on success or None
def clarisse_helper.delete_item (   item)

Delete the specified item (object or context)

Parameters
itemPath to the item to delete, for example: 'project://scene/light'
Note
You can't undo this action.
def clarisse_helper.export_context_as_project (   context,
  filename 
)

Export a context to the specified project filename.

Parameters
appApplication object
contextContext
filenameproject filename
Returns
True on success, False on failure
def clarisse_helper.export_context_as_project_with_dependencies (   context,
  filename 
)

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

Parameters
appApplication object
contextContext
filenameproject filename
Returns
True on success, False on failure
def clarisse_helper.export_geometries (   filename,
  geometry_objects 
)

Exports the geometry given as parameter.

Parameters
filenameoutput Geometry filename
OfObjectVectorvector of Geometries to export
Note
A single geometry file can define multiple geometries.
def clarisse_helper.export_geometry (   filename,
  geometry_object 
)

Exports the geometry given as parameter.

Parameters
filenameoutput Geometry filename.
geometry_objectto export
def clarisse_helper.export_render_archive (   filename)

Export the current project as render archive.

Parameters
filenameClarisse render archive filename
Returns
true if the render archive has been successfully exported.
Note
this function can only be called from within an interactive Clarisse session.
def clarisse_helper.get_item (   item_name)

Return the item (OfContext or OfObject) from the specified name.

Parameters
item_nameName of the item to get, for example: 'project://scene/light'
Returns
Return None if it fails to locate the specified item
def clarisse_helper.import_geometries (   filenames)

Return an array of OfObject if the specified geometry has been successfully loaded.

Parameters
filenamesGeometry filenames.
Note
A single geometry file can define multiple geometries. This is why this function returns a array of OfObject
def clarisse_helper.import_geometry (   filename)

Return a OfObject if the specified geometry has been successfully loaded.

Parameters
filenameGeometry filename.
Note
A single geometry file can define multiple geometries. This is why this function returns an OfObject
def clarisse_helper.import_image (   filename)

Return a OfObject if the specified image has been successfully loaded.

Parameters
filenameImage filename.
def clarisse_helper.import_images (   filenames)

Return an array of OfObject if the specified images has been successfully loaded.

Parameters
filenamesImages filenames.
def clarisse_helper.import_map_file (   filename,
  class_name,
  suffix 
)

Return a OfObject if the specified image has been successfully loaded.

Parameters
filenameImage filename.
class_nameClass name.
suffixSuffix object created.
def clarisse_helper.import_map_files (   filenames,
  class_name,
  suffix 
)

Return an array of OfObject if the specified images has been successfully loaded.

Parameters
filenamesImages filenames.
class_nameClass name.
suffixSuffix object created.
def clarisse_helper.import_project (   filename)

Return the created context containing the scene if the specified file has been successfully loaded.

Parameters
filenameScene filename.
def clarisse_helper.import_scene (   filename)

Return the created context containing the scene if the specified file has been successfully loaded.

Parameters
filenameScene filename.
def clarisse_helper.import_volume (   filename)

Return a OfObject if the specified volume has been successfully loaded.

Parameters
filenameVolume filename.
Note
A single volume file can define multiple volumes. This is why this function returns the created context containing the volume
def clarisse_helper.import_volumes (   filenames)

Return an array of OfObject if the specified volumes has been successfully loaded.

Parameters
filenamesVolume filenames.
Note
A single volume file can define multiple volumes. This is why this function returns the created context containing the volume
def clarisse_helper.is_context_exists (   context_name)

Return True if the specified context exists.

Parameters
context_nameName of the context, for example: 'project://scene'
def clarisse_helper.is_gui_application ( )

Return True if the application is running in GUI mode Use this method if you are doing specific GUI actions to check if the application is running in UI mode.

Typically Clarisse returns true, where cnode returns false.

def clarisse_helper.is_interactive_application ( )

Return True if the application is running in interactive mode An interactive application, is an application that behaves like a command-line shell.

Typically cnode returns true when it has been launched with the flag -interactive.

def clarisse_helper.is_process_application ( )

Return True if the application is running in process mode A process application, is an application which doesn't take input.

Typically cnode returns true when it running as a renderer and will return false if running in interactive mode

def clarisse_helper.item_exists (   item_name)

Return the specified item (OfContext or OfObject) if it exists.

Parameters
item_nameName of the item, for example: 'project://scene/light'
Returns
Return None if the item doesn't exists
def clarisse_helper.load_project (   filename)

Load the specified Clarisse project file.

Parameters
filenameClarisse project filename Loading a project will clear all the items that are in the current project.
def clarisse_helper.log_error (   message)

Output the specified error message.

Parameters
messageinput message
def clarisse_helper.log_info (   message)

Output the specified info message.

Parameters
messageinput message
def clarisse_helper.log_warning (   message)

Output the specified warning message.

Parameters
messageinput message
def clarisse_helper.reference_export_context (   context,
  filename 
)

Export a context to the specified project filename, and convert the context to a reference context that refernces the exported project.

Parameters
appApplication object
contextContext
filenamesproject filename
Returns
True on success, False on failure
def clarisse_helper.reference_file (   working_context,
  filename 
)

When a single file is specified, return the OfContext that has been successfully referenced.

When an array of filenames is specified, returns True in case of success.

Parameters
working_contextContext that will contain the referenced asset
filenameAsset filename(s)
def clarisse_helper.reference_files (   working_context,
  filenames 
)

Return an array of OfContexts if the specified files have been successfully referenced.

Parameters
working_contextContext that will contain the referenced assets
filenamesAsset filenames
def clarisse_helper.reference_make_local (   context)

Make local object from the specified a reference.

Parameters
appApplication object
contextContext that will a local context
def clarisse_helper.render_image (   image)

Render the specified image item and return the rendered image.

Parameters
imageClarisse path to an image item that can be either a string or an OfObject
Returns
The rendered image is returned as an ImageHandle
def clarisse_helper.save_project (   filename)

Save the current project.

Parameters
filenameClarisse project filename
def clarisse_helper.set_current_context (   context_path)

Set the current working context (Global slot)

Parameters
context_pathPath the the context that will be set as the current working context
Note
By default all new items are created in the current working context.
def clarisse_helper.set_current_frame (   frame_number)

Set the current frame number to the specified frame.

Parameters
frame_numberFrame number.