Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
ModuleObjectCallbacks Class Reference
Inheritance diagram for ModuleObjectCallbacks:
OfClassCallbacks ModuleAovStoreCallbacks ModuleConstraintCallbacks ModuleDeformerCallbacks ModuleGlObjectCallbacks ModuleGroupCallbacks ModuleIntegratorCallbacks ModuleKernelFilterCallbacks ModuleLanguageCallbacks ModuleLayerCallbacks ModuleLpeCallbacks ModuleLpeConstantCallbacks ModuleMaterialCallbacks ModulePixelFilterCallbacks ModuleProcessCallbacks ModuleRendererCallbacks ModuleScriptingCallbacks ModuleSubPixelFilterCallbacks ModuleToolCallbacks ModuleWholeImageFilterCallbacks ModuleWidgetCallbacks

Public Types

typedef void(* OnDestroyModuleCallback )(OfObject &)
 Called before the module deletion.
 
typedef ResourceData *(* CreateResourceCallback )(OfObject &, const int &, void *)
 Called lazily when a resource is not cached and has to be created.
 
typedef ResourceData *(* SetResourceDataCallback )(OfObject &, const int &, void *, const size_t &, const CoreString &)
 Deserialization callback for project resources.
 
typedef void(* OnResourceUpdateCallback )(OfObject &, const int &, const ResourceData *)
 Called everytime a resource is updated.
 
typedef CoreString(* MakeResourceKeyCallback )(OfObject &)
 Allows to generate a custom hash key for an object when a resource depends on it.
 
typedef CoreString(* GetResourceKeyCallback )(OfObject &, ResourceID, GeometryResourceOverride *)
 
typedef void(* InitiliazeResourcesCallback )(OfObject &)
 
typedef CoreString(* MakeAttributeKeyCallback )(const OfAttr &)
 Allows to generate a custom hash key for a given attribute. This callback is only called when needed, and on attributes which are listened to by a resource.
 
typedef ModuleCma *(* CreateCmaCallback )(const CtxEval *)
 Create a Clarisse Module Accessor class for this module, during this evaluation.
 
typedef bool(* OnNewTime )(OfObject &, const double &)
 Notifies an object every time the main evaluation time changes (using the Timeline widget for instance), to update it and evaluate whether the object state changed or not with the time update.
 
typedef bool(* RequestVariable )(OfObject &, CoreHashTable< unsigned int, OfObjectVariableValue * > &variables)
 Does nothing.
 
typedef void(* RegisterVariable )(OfObject &, const CoreBasicArray< OfObjectVariableValue * > &variables, CoreVector< unsigned int > &unknown_variable_indices)
 Called to gather the variables defined in the OfObject and their values, among those requested by the application.
 
typedef void(* UnRegisterVariable )(OfObject &, const CoreBasicArray< OfObjectVariableValue * > &variables)
 Called to notify when variables are no longer needed by the application.
 
typedef void *(* CreateClassEvalData )(const OfClass &, const CtxEval &)
 Create a class evaluation data, that will be shared by all objects of this particular class during this evaluation.
 
typedef void(* DestroyClassEvalData )(const OfClass &, const CtxEval &, void *)
 Delete a class evaluation data, that has been shared by all objects of this particular class during this evaluation.
 
typedef void *(* CreateEvalData )(const OfObject &, const CtxEval &)
 Create an object evaluation data, that will be used by this particular object during this evaluation.
 
typedef void(* DestroyEvalData )(const OfObject &, const CtxEval &, void *)
 Delete an object evaluation data, that has been used by this particular object during this evaluation.
 
typedef void *(* CreateThreadData )(const OfObject &, const CtxEval &)
 Create an object thread data, that will be bound to both the current evaluation thread and the object during this evaluation.
 
typedef void(* DestroyThreadData )(const OfObject &, const CtxEval &, void *)
 Delete an object thread data, that was bound to both one evaluation thread and the object during this evaluation.
 
typedef void(* PostEvaluate )(const OfObject &, const CtxEval &)
 Called once at the end of an evaluation, if the object was referenced in the evaluation graph.
 
typedef void(* GetAttrPresetHints )(const OfObject &, const OfAttr &, CoreArray< bool > &)
 Allows to dynamically enable or disable entries among the list of preset values for an attribute on an object.
 
typedef void(* GetTrackingFilenames )(const OfObject &, const CoreString &, CoreArray< CoreString > &)
 Allows to customize on the fly the filenames to track for resources dirtiness.
 
typedef unsigned int(* GetObjectVariableLong )(const OfObject &, const CoreString &, long long *, const unsigned int &)
 Fetch the values of a variable in an object, typed as a long long.
 
typedef unsigned int(* GetObjectVariableDouble )(const OfObject &, const CoreString &, double *, const unsigned int &)
 Fetch the values of a variable in an object, typed as a double.
 
typedef GuiWidget *(* DeclareCustomUi )(const CoreVector< OfAttrHandle > &, GuiWidget &, void *custom_data)
 Create a custom user interface for an attribute of type custom_ui.
 
typedef GuiSpreadsheetCell *(* GetCustomTableCellUi )(const OfAttrTable &table, GuiSpreadsheetRow &parent, unsigned int column, unsigned int row, bool enabled)
 Create a custom spreadsheet cell for a column attribute (e.g. which is part of a table) that has been flagged with custom_cell_ui yes in its definition. When implementing this callback, you only have to create the correct spreadsheet cell type and initialize its content based on the table. Its enabled state will be set automatically.
 
typedef CoreString(* GetCustomAttributeLabel )(const OfAttr &attribute)
 
- Public Types inherited from OfClassCallbacks
typedef OfModule *(* CreateModuleCallback )(OfObject &, OfObjectFactory &)
 
typedef bool(* DestroyModuleCallback )(OfObject &, OfObjectFactory &, OfModule *)
 
typedef void(* ModuleConstructorCallback )(OfObject &, OfModule *)
 
typedef void(* ModuleDestructorCallback )(OfObject &, OfModule *)
 
typedef void *(* CreateModuleDataCallback )(const OfObject &)
 
typedef bool(* DestroyModuleDataCallback )(const OfObject &, void *)
 
typedef void(* OnAttributeChangeCallback )(OfObject &, const OfAttr &, int &, const int &)
 
typedef void(* OnSendEventCallback )(OfObject &, const CoreString &)
 
typedef void(* OnSerializeObjectCallback )(OfObject &)
 
typedef void(* OnPreDeserializeCallback )(OfObject &, const CoreVersion &, ParserGroup &parser_group)
 
typedef void(* OnPreDeserializeObjectCallback )(const CoreVersion &, ParserGroup &parser_group)
 
typedef void(* OnDeserializeObjectCallback )(OfObject &, const CoreVersion &, const ParserGroup &parser_group, const OfSerialOptions &serial_options)
 
typedef void(* SerializeUserDataCallback )(const OfObject &, ParserGroup &)
 
typedef void(* DeserializeUserDataCallback )(const OfObject &, const ParserGroup &)
 
typedef void(* PreProcessOverrideCallback )(OfObject &object, OfOverrides &overrides, const CoreString &obj_key)
 
typedef OfItemHandle(* GetTraversalItemCallback )(OfObject &object)
 
typedef ResourceData *(* CreateResourceCustomCallback )(OfObject &, void *)
 
typedef void(* OnResourceUpdateCustomCallback )(OfObject &, const int &, const ResourceData *)
 
typedef ResourceData *(* CreateResourceCustomOverrideCallback )(OfObject &, GeometryOverride &, void *)
 
typedef void(* SetShadingLayerValuesCallback )(OfObject &object, const CoreBasicArray< OfObject * > &, const CoreBasicArray< OfObject * > &, const CoreBasicArray< OfObject * > &)
 

Public Member Functions

void init_parent_callbacks (OfClass &base_class)
 
virtual void init_callbacks (OfClassCallbacks &callbacks)
 

Public Attributes

OnDestroyModuleCallback cb_on_destroy_module
 
CreateResourceCallback cb_create_resource
 
SetResourceDataCallback cb_set_resource_data
 
OnResourceUpdateCallback cb_on_resource_update
 
MakeResourceKeyCallback cb_make_resource_key
 
GetResourceKeyCallback cb_get_resource_key
 
InitiliazeResourcesCallback cb_initialize_resources
 
MakeAttributeKeyCallback cb_make_attribute_key
 
CreateCmaCallback cb_create_cma
 
OnNewTime cb_on_new_time
 
RequestVariable cb_request_variables
 
RegisterVariable cb_register_variables
 
UnRegisterVariable cb_unregister_variables
 
CreateClassEvalData cb_create_class_eval_data
 
DestroyClassEvalData cb_destroy_class_eval_data
 
CreateEvalData cb_create_eval_data
 
DestroyEvalData cb_destroy_eval_data
 
CreateThreadData cb_create_thread_data
 
DestroyThreadData cb_destroy_thread_data
 
PostEvaluate cb_post_evaluate
 
GetAttrPresetHints cb_get_attr_preset_hints
 
GetTrackingFilenames cb_get_tracking_filenames
 
GetObjectVariableLong cb_get_object_variable_long
 
GetObjectVariableDouble cb_get_object_variable_double
 
DeclareCustomUi cb_declare_custom_ui
 
GetCustomAttributeLabel cb_get_custom_attribute_label
 
GetCustomTableCellUi cb_get_custom_table_cell_ui
 
- Public Attributes inherited from OfClassCallbacks
CreateModuleCallback cb_create_module
 
DestroyModuleCallback cb_destroy_module
 
ModuleConstructorCallback cb_module_constructor
 
ModuleDestructorCallback cb_module_destructor
 
CreateModuleDataCallback cb_create_module_data
 
DestroyModuleDataCallback cb_destroy_module_data
 
OnAttributeChangeCallback cb_on_attribute_change
 
OnSendEventCallback cb_on_send_event
 
OnSerializeObjectCallback cb_on_serialize_object
 
OnDeserializeObjectCallback cb_on_deserialize_object
 
OnPreDeserializeCallback cb_on_pre_deserialize
 
OnPreDeserializeObjectCallback cb_on_pre_deserialize_object
 
SerializeUserDataCallback cb_serialize_user_data
 
DeserializeUserDataCallback cb_deserialize_user_data
 
PreProcessOverrideCallback cb_pre_process_override
 
GetTraversalItemCallback cb_get_traversal_item
 
SetShadingLayerValuesCallback cb_set_shading_layer_values
 

Member Typedef Documentation

typedef void*(* ModuleObjectCallbacks::CreateClassEvalData)(const OfClass &, const CtxEval &)

Create a class evaluation data, that will be shared by all objects of this particular class during this evaluation.

Note
Called lazily at the first request.
Parameters
[in]OfClassThe class requesting an evaluation data.
[in]CtxEvalThe current evaluation context.
Returns
A pointer on the class specific evaluation data for the current evaluation.
typedef ModuleCma*(* ModuleObjectCallbacks::CreateCmaCallback)(const CtxEval *)

Create a Clarisse Module Accessor class for this module, during this evaluation.

Note
The callback implementation is generated by cmagen, using the Clarisse Interface Descriptor (cid file), and set by the IX_CREATE_MODULE_CLBK.
You probably don't want to implement it yourself.
Parameters
[in]CtxEvalThe current evaluation context.
Returns
A new Clarisse Module Accessor.
typedef void*(* ModuleObjectCallbacks::CreateEvalData)(const OfObject &, const CtxEval &)

Create an object evaluation data, that will be used by this particular object during this evaluation.

Note
Called lazily at the first request.
Parameters
[in]OfObjectThe object requesting an evaluation data.
[in]CtxEvalThe current evaluation context.
Returns
A pointer on the object specific evaluation data for the current evaluation.
typedef ResourceData*(* ModuleObjectCallbacks::CreateResourceCallback)(OfObject &, const int &, void *)

Called lazily when a resource is not cached and has to be created.

Note
This callback will be called recursively on the class inheritance tree until a non null resource is found.
Do not return intentionally a nullptr for the resource you are responsible for.
It would trigger multiple attempts to create this resource and dramatically slow down the evaluation.
Parameters
[in]OfObjectThe object the resource has been requested on.
[in]intThe resource slot index.
[in]voidA pointer on a user data, associated to this resource creation callback.
Returns
The newly created resource.
typedef void*(* ModuleObjectCallbacks::CreateThreadData)(const OfObject &, const CtxEval &)

Create an object thread data, that will be bound to both the current evaluation thread and the object during this evaluation.

Note
Called lazily at the first request.
Parameters
[in]OfObjectThe object requesting a thread data.
[in]CtxEvalThe current evaluation context.
Returns
A pointer on the object specific thread data for the current evaluation.
typedef GuiWidget*(* ModuleObjectCallbacks::DeclareCustomUi)(const CoreVector< OfAttrHandle > &, GuiWidget &, void *custom_data)

Create a custom user interface for an attribute of type custom_ui.

Note
All attributes in the vector are the same ones, on different objects.
It allows to handle the multi-selection on objects containing custom user interfaces.
Here is a cid file example, declaring a custom UI for the attribute "sample_ui":
#cid file example, declaring a custom UI
class "SceneObjectSample" "SceneObject" {
attribute_group "sample_group" {
custom_ui "sample_ui" {
}
}
}
Parameters
[in]CoreVector<OfAttr*> List of attributes to display by the custom UI.
[in]GuiWidgetThe parent widget.
[in]custom_dataUnused at the moment, always set to nullptr. Reserved for future use.
Returns
The custom widget to display in the parent widget.
typedef void(* ModuleObjectCallbacks::DestroyClassEvalData)(const OfClass &, const CtxEval &, void *)

Delete a class evaluation data, that has been shared by all objects of this particular class during this evaluation.

Note
Called at the end of an evaluation, when the CtxEval is about to be destroyed.
Will be called only if the class evaluation data has been requested at least once during the evaluation.
Parameters
[in]OfClassThe class owning the class evaluation data.
[in]CtxEvalThe current evaluation context.
[in]voidThe pointer on the class evaluation data to delete.
typedef void(* ModuleObjectCallbacks::DestroyEvalData)(const OfObject &, const CtxEval &, void *)

Delete an object evaluation data, that has been used by this particular object during this evaluation.

Note
Called at the end of an evaluation, when the CtxEval is about to be destroyed.
Will be called only if the object evaluation data has been requested at least once during the evaluation.
Parameters
[in]OfObjectThe object owning the object evaluation data.
[in]CtxEvalThe current evaluation context.
[in]voidThe pointer on the object evaluation data to delete.
typedef void(* ModuleObjectCallbacks::DestroyThreadData)(const OfObject &, const CtxEval &, void *)

Delete an object thread data, that was bound to both one evaluation thread and the object during this evaluation.

Note
Called at the end of an evaluation, when the CtxEval is about to be destroyed.
Will be called only if the thread object evaluation data has been requested at least once during the evaluation.
Parameters
[in]OfObjectThe object owning the thread data.
[in]CtxEvalThe current evaluation context.
[in]voidThe pointer on the thread object evaluation data to delete.
typedef void(* ModuleObjectCallbacks::GetAttrPresetHints)(const OfObject &, const OfAttr &, CoreArray< bool > &)

Allows to dynamically enable or disable entries among the list of preset values for an attribute on an object.

Parameters
[in]OfObjectThe object containing the attribute.
[in]OfAttrThe attribute to configure the preset on.
[out]CoreArray<bool>One entry per preset, true if enabled, false otherwise.
typedef CoreString(* ModuleObjectCallbacks::GetCustomAttributeLabel)(const OfAttr &attribute)

Get the custom label for the specified attribute, to be used for the UI (e.g. Attribuite Editor).

The callback should return a non-empty string in order to replace the custom label generated by the application. If the callback returns an empty string, the application will use the default label.

Parameters
attributeThe attribute.
Returns
A non-empty string if the custom attribute is defined. Otherwise an empty string.
typedef GuiSpreadsheetCell*(* ModuleObjectCallbacks::GetCustomTableCellUi)(const OfAttrTable &table, GuiSpreadsheetRow &parent, unsigned int column, unsigned int row, bool enabled)

Create a custom spreadsheet cell for a column attribute (e.g. which is part of a table) that has been flagged with custom_cell_ui yes in its definition. When implementing this callback, you only have to create the correct spreadsheet cell type and initialize its content based on the table. Its enabled state will be set automatically.

Parameters
tableThe table.
parentThe parent spreadsheet row. Need by most spreadsheet cell constructors.
columnThe index of the cell's column.
rowThe index of the cell's row.
enabledThe enabled state of the cell. It's provided for convenience (depends on the states of the columns and the rows)
Returns
The GuiSpreadsheetCell instance to use for the given cell, or nullptr if you want to use the default cell type.
typedef unsigned int(* ModuleObjectCallbacks::GetObjectVariableDouble)(const OfObject &, const CoreString &, double *, const unsigned int &)

Fetch the values of a variable in an object, typed as a double.

Note
Never called natively by Clarisse, but might be called via the SDK function ModuleObject::get_object_variable by plugins or users.
Parameters
[in]OfObjectThe object to fetch the variable on.
[in]CoreStringThe variable name.
[out]double*The array of fetched values.
[in]unsignedThe number of values to fetch inside the variable.
Returns
The number of value fetched in the object.
typedef unsigned int(* ModuleObjectCallbacks::GetObjectVariableLong)(const OfObject &, const CoreString &, long long *, const unsigned int &)

Fetch the values of a variable in an object, typed as a long long.

Note
Never called natively by Clarisse, but might be called via the SDK function ModuleObject::get_object_variable by plugins or users.
Parameters
[in]OfObjectThe object to fetch the variable on.
[in]CoreStringThe variable name.
[out]long*The array of fetched values.
[in]unsignedThe number of values to fetch inside the variable.
Returns
The number of value fetched in the object.
typedef CoreString(* ModuleObjectCallbacks::GetResourceKeyCallback)(OfObject &, ResourceID, GeometryResourceOverride *)

This callback will be used to compute a resource's key when it has been flagged as a "user key" resource.

Note
This is only called for resources that have been set as "user key". See OfClass::set_resource_user_key
Parameters
objectThe object containing the resource
idThe resource id
overrideOptional override on the resource
Returns
The unique hash key for the resource.
typedef void(* ModuleObjectCallbacks::GetTrackingFilenames)(const OfObject &, const CoreString &, CoreArray< CoreString > &)

Allows to customize on the fly the filenames to track for resources dirtiness.

Note
Called only if a resource has a filename attribute as dependency on this object.
Parameters
[in]OfObjectThe object owning the resource.
[in]CoreStringThe value of the filename attribute.
[out]CoreArray<CoreString>The final list of filenames to track to ensure the resource is up to date.
typedef void(* ModuleObjectCallbacks::InitiliazeResourcesCallback)(OfObject &)

This is called only once, the first time a resource from the given object is needed. This can be used to load intermediate data to compute resource keys, for instance.

Parameters
objectThe object whose resources will be used.
typedef CoreString(* ModuleObjectCallbacks::MakeAttributeKeyCallback)(const OfAttr &)

Allows to generate a custom hash key for a given attribute. This callback is only called when needed, and on attributes which are listened to by a resource.

Parameters
attrThe attribute to generate the key of.
Returns
The key. If you return an empty string, the default implementation is used (e.g. the attribute will have the key it would've had if you didn't use this callback)
typedef CoreString(* ModuleObjectCallbacks::MakeResourceKeyCallback)(OfObject &)

Allows to generate a custom hash key for an object when a resource depends on it.

Note
A resource depends on an object, if one of its attribute dependency is a reference to this object.
Parameters
[in]OfObjectThe object to compute the hash key on.
Returns
The unique hash key of the object.
typedef void(* ModuleObjectCallbacks::OnDestroyModuleCallback)(OfObject &)

Called before the module deletion.

Deprecated:
Implement the DestroyModule callback in the OfClass instead.
Parameters
[in]OfObjectThe object about to be deleted.
typedef bool(* ModuleObjectCallbacks::OnNewTime)(OfObject &, const double &)

Notifies an object every time the main evaluation time changes (using the Timeline widget for instance), to update it and evaluate whether the object state changed or not with the time update.

Note
Returning true will automatically dirty the resources depending on this object.
Parameters
[in]OfObjectThe object notified.
[in]doubleThe new time value.
Returns
true if the time change dirtied the object, false otherwise.
typedef void(* ModuleObjectCallbacks::OnResourceUpdateCallback)(OfObject &, const int &, const ResourceData *)

Called everytime a resource is updated.

Parameters
[in]OfObjectThe object linked to the updated resource.
[in]intThe resource slot index.
[in]ResourceDataThe updated resource.
typedef void(* ModuleObjectCallbacks::PostEvaluate)(const OfObject &, const CtxEval &)

Called once at the end of an evaluation, if the object was referenced in the evaluation graph.

Note
Called at the end of an evaluation, when the CtxEval is about to be destroyed.
Parameters
[in]OfObjectThe object that was part of the evaluation.
[in]CtxEvalThe current evaluation context.
typedef void(* ModuleObjectCallbacks::RegisterVariable)(OfObject &, const CoreBasicArray< OfObjectVariableValue * > &variables, CoreVector< unsigned int > &unknown_variable_indices)

Called to gather the variables defined in the OfObject and their values, among those requested by the application.

Parameters
[in]OfObjectThe object to gather the variables on.
[in]variablesVariables requested by the application.
[out]unknown_variable_indicesMust be filled with the index of each variable that is not defined in the object.
typedef bool(* ModuleObjectCallbacks::RequestVariable)(OfObject &, CoreHashTable< unsigned int, OfObjectVariableValue * > &variables)

Does nothing.

Deprecated:
No longer called, will be removed soon.
Parameters
[in]OfObjectThe object to request the variable on.
[in]variablesFancy useless hash table.
Returns
Whether true or false, doesn't matter anyway.
typedef ResourceData*(* ModuleObjectCallbacks::SetResourceDataCallback)(OfObject &, const int &, void *, const size_t &, const CoreString &)

Deserialization callback for project resources.

Note
The serialization step is handled by the resource object itself, but its deserialization has to be handled at the object level.
Parameters
[in]OfObjectThe object containing the project resource.
[in]intThe resource slot index.
[in]voidA pointer on the raw data to deserialize.
[in]size_tThe size of the raw data to deserialize.
[in]CoreStringThe serialized resource unique hash key.
Returns
The deserialized resource object.
typedef void(* ModuleObjectCallbacks::UnRegisterVariable)(OfObject &, const CoreBasicArray< OfObjectVariableValue * > &variables)

Called to notify when variables are no longer needed by the application.

Parameters
[in]OfObjectThe object to notify.
[in]variablesVariables no longer needed by the application.