mgear.animbits.cache_manager.query module

mgear.animbits.cache_manager.query.find_model_group_inside_rig(geo_node, rig_node)

Finds the given group name inside the hierarchy of a rig

Parameters:
  • geo_node (str) – geometry group transform node containing the shapes to cache

  • rig_node (str) – Rig root node containing the geo_node

Returns:

Full path to the geo_node if found else None

Return type:

str or None

mgear.animbits.cache_manager.query.get_cache_destination_path()

Returns the cache destination path

This methods returns a path pointing to where the cache manager will store the GPU caches.

If the MGEAR_CACHE_MANAGER_CACHE_DESTINATION environment variable has been set it will return whatever path has been set if valid. If none has been set or fails to use that path this method tries then to return whatever settings has been set on the cache manager preferences file.

Finally if no environment variable or preference file is been set then we use the OS TEMP folder as destination path.

Returns:

cache destination path

Return type:

str

mgear.animbits.cache_manager.query.get_model_group(ignore_selection=False)

Returns the model group name to cache

This methods returns a string with the name of the transform node to use when caching the geometry/model

If the MGEAR_CACHE_MANAGER_MODEL_GROUP environment variable has been set it will return the name stored in it. If none has been set or fails to use that name this method tries then to return whatever settings has been set on the cache manager preferences file.

Finally if no environment variable or preference file is been set then we fall back to selection.

This doesn’t check if the returner values is a valid value like if the transform node exists. This is because we do not know at this stage if the asset it inside a namespace or something scene specific. As this is generic only checks for that generic part are been made.

Parameters:

ignore_selection (bool) – whether it falls back to the selected group

Returns:

group name if anything or None

Return type:

str or None

mgear.animbits.cache_manager.query.get_preference_file()

Returns the preference file path and name

Returns:

preference file path and name

Return type:

str

mgear.animbits.cache_manager.query.get_preference_file_cache_destination_path()

Returns the folder path set on the preference file

Returns:

The path stored in the preference file or None if invalid

Return type:

str or None

mgear.animbits.cache_manager.query.get_preference_file_model_group()

Returns the model group name set on the preference file

Returns:

Model group name stored in the preference file

or None if invalid

Return type:

str or None

mgear.animbits.cache_manager.query.get_scene_rigs()

The rigs from current Maya session

This method search for rigs in your current Maya scene. If the MGEAR_CACHE_MANAGER_RIG_ATTRIBUTE has been set it will try to find rigs based on the attribute set on the environment variable. Otherwise it will use the attribute gear_version in order to find rigs in scene.

Returns:

mGear rig top node or None

Return type:

list or None

mgear.animbits.cache_manager.query.get_time_stamp()

Returns the date and time in a file name friendly way

This is used to create the cache file name a unique name in order to avoid clashing files overwriting other cache files been used on other specific file scenes

Returns:

time stamp (19-05-12_14-10-55) year-month-day_hour-minutes-seconds

Return type:

str

mgear.animbits.cache_manager.query.get_timeline_values()

Returns the min and max keyframe values from the current playback range

In order to give more freedom to the artist we always evaluate the playback range and not the animation range so that artists can choose what range to use when creating the GPU cache

Returns:

min and max value

Return type:

float, float

mgear.animbits.cache_manager.query.is_rig(rig_node)

Returns whether the given rig node is in srig state or caching state

Parameters:

rig_node (str) – rig node name

mgear.animbits.cache_manager.query.read_preference_key(search_key)

Returns the preference stored on the pref file for the given key

Returns:

The path stored in the preference file or None if invalid

Return type:

str or None