mgear.core.string module

string management methods

mgear.core.string.convertRLName(name)

Convert a string with underscore

i.e: “_L”, “_L0_”, “L_”, “_L” to “R”. And vice and versa.

Parameters:

name (string) – string to convert

Returns:

Tuple of Integer

mgear.core.string.convertRLName_old(name)

Convert a string with underscore

i.e: “_L”, “_L0_”, “L_”, “_L” to “R”. And vice and versa.

Parameters:

name (string) – string to convert

Returns:

Tuple of Integer

mgear.core.string.normalize(string)

Replace all invalid characters with “_”

Parameters:

string (string) – A string to normalize.

Return string:

Normalized string

mgear.core.string.normalize2(string)

Replace all invalid characters with “_”. including “-” This ensure that the name is compatible with Maya naming rules

Parameters:

string (string) – A string to normalize.

Return string:

Normalized string

mgear.core.string.normalize_path(string)

Ensure that string path use always forward slash

Parameters:

string (TYPE) – Description

Returns:

Description

Return type:

TYPE

mgear.core.string.normalize_with_padding(string)

Replace all invalid characters with “_”. including “-” This ensure that the name is compatible with Maya naming rules

Also list of # symbol with properly padded index.

ie. count_### > count_001

Parameters:

string (string) – A string to normalize.

Return string:

Normalized string

mgear.core.string.removeInvalidCharacter(string)

Remove all invalid character.

Parameters:

string (string) – A string to normalize.

Return string:

Normalized string.

mgear.core.string.removeInvalidCharacter2(string)

Remove all invalid character. Incluede “_” and “.”as valid character.

Parameters:

string (string) – A string to normalize.

Return string:

Normalized string.

mgear.core.string.replaceSharpWithPadding(string, index)

Replace a list of # symbol with properly padded index.

ie. count_### > count_001

Parameters:
  • string (string) – A string to set. Should include ‘#’

  • index (integer) – Index to replace.

Return string:

Normalized string.