'File' menu -> 'Rig Export'
'Rig Export' is an optional tool that checks the rig and exports different types of rigs.
The top half of the UI runs checks on the rig, and the bottom half displays actions to take when exporting the rig.
Checks:
By pressing the 'Run All' button, you can run all the checks and fix any issues you find by pressing the 'Fix' button.
Checks have a description of what they do.
Actions:
There is also a description of each action, but a couple of actions should be explained in more detail:
- Clean Arise Data: Reduce the exported Rig file size by deleting the saved Arise scene data ('Loading/Saving')
- Export Game FBX rig: If you used the 'FollowSkeleton' attachment to create a game engine rig, you can tick 'Export Game FBX rig' which will export an FBX file with only the 'geometry_grp' and the 'skeleton_grp'.
- Calamari Rig: Creates another Maya rig file without skinning; instead, the meshes are cut according to their skinning and parented to the joints. This is a fast rig version for animators.
Save Path:
In the 'Save Path' field, enter the path where the rig should be saved.
If you ticked actions that create more rig files, such as 'Calamari Rig', these will be created in the same folder.
When you click on 'Export Rig', the actions will start executing and the rig(s) will be exported.
A summary of the export results can be found in Maya's Script Editor.
Notes:
- Save the Maya scene before exporting the rig, and this tool will prompt you to do so.
- Actions that are checked will run in the order they appear.
- ARISE nodes will be in their 'None' state after the export process and will need to be rebuilt.
- As of version 1.11.00 FBX and Calamari rigs are exported with all tagging attributes removed.
Creating Custom Actions: (As of version 1.13.00)
Creating custom actions is straightforward.
To add an action, create a Python file in the folder: '...\arise\rig_exporter\actions'.
Arise will automatically detect both compiled (.pyc) and uncompiled (.py) modules in this folder.
Start with the following example code and modify it to suit your needs:
""" Example Action module code: ReferencesAction is the operations done when saving to import namespaces. """ import maya.cmds as mc from arise.utils.decorators_utils import simple_catch_error_dec class ReferencesAction(object): # rename the class to an appropriate name. """ReferencesAction is the operation to import namespaces into the scene. """ def __init__(self): self.name = "Import References" # rename action name appropriately. self.info = "Import any references in scene on export" # short description of action. self.position = 100 # position in the action list. self.is_checked = True # If action is checked by default. self.post_action = False # post actions are executed after the rig is saved, for example: to create a calamari rig or fbx rig. @staticmethod @simple_catch_error_dec def run_action(_): """Code to execute the action. If post_actions is True, accepts an optional save_path argument to save an additional rig file if needed. """ for ref_path in mc.file(q=True, reference=True): namespace = mc.referenceQuery(ref_path, namespace=True, shortName=True) mc.file(ref_path, importReference=True) mc.namespace(removeNamespace=namespace, mergeNamespaceWithRoot=True) return "Action successful" # return a string to be displayed in the export summary.
If your action raises an error, Arise will print the error in Maya's Script Editor but will continue executing the next action. Therefore, it’s recommended to handle potential errors within your action code to prevent unexpected behavior.
Creating Custom Checks: (As of version 1.13.00)
Creating custom checks is straightforward and works similarly to adding custom actions.
To add a check, create a Python file in the folder 'arise\rig_exporter\checks'.
Arise will automatically detect both compiled (.pyc) and uncompiled (.py) modules in this folder.
Start with the following example code and modify it to suit your needs:
""" Example check module code: Removes the known Maya viruses from the scene. This is a partial solution as it only removes the script nodes and does not modifies the userSetup.py that might also be corrupted. https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/How-to-diagnose-and-clean-Maya-ScriptExploit-issues.html """ import maya.cmds as mc from arise.rig_exporter.checks.abstract_check.abstract_check import AbstractCheckData INFECTED_SCRIPT_NODES_NAMES = ["vaccine_gene", "breed_gene", "MayaMelUIConfigurationFile"] class RemoveViruses(AbstractCheckData): # rename to your check class name """Checks the Maya scene for the known viruses and removes them. """ def __init__(self, main): AbstractCheckData.__init__(self, main) self.name = "Remove Viruses" # rename to your check name self.info = ( # write your check description here "Searches for script nodes that contain known viruses in Maya scenes.\n" "This is a partial solution and Maya's 'MayaScanner' plugin should be installed." ) self.has_fix = True # True if the check has a fix function False otherwise. self.type = "warning" # "warning" or "error". Errors are displayed red in the UI. self.error_msg = "" # leave empty and set in the check function if needed. self.position = 250 # the order of the check in the UI. def check(self): """Check logic subclasses will be placed here. Can set the self.error_msg to a string to display error message in the UI. Returns: bool: True if passed else False """ error_msg = "" for infected_node in mc.ls(INFECTED_SCRIPT_NODES_NAMES, type="script") or []: error_msg += "found the virus '{0}' script node in the scene.".format(infected_node) if error_msg: self.error_msg = error_msg return False return True def fix(self): """Check fix logic subclasses will be placed here. if has_fix is True this function will be called when the user presses the fix button in the UI. The 'check' function will be called again after this function. """ for infected_node in mc.ls(INFECTED_SCRIPT_NODES_NAMES, type="script") or []: mc.delete(infected_node) print("Deleted {0}".format(infected_node))
As with actions, if your check raises an error, Arise will print it in Maya's Script Editor but will continue executing the next check. Therefore, it’s recommended to handle potential errors within your check code to prevent unexpected behavior.
_____________________________________________
Get Arise at: https://www.ariserigging.com