Render Anmations in Autodesk Maya
This part describes the methods/classes we apply to render animations in Autodesk Maya.
- class render.maya.utils.MayaController(PORT=12345)[source]
Bases:
objectThis is controller to remotely control Maya to make character animations. The default local host is 127.0.0.1
- Parameters
PORT (int) – port to connect to the local socket server, defaults to 0
- Variables
client – socket client
- GetAllObjects()[source]
Get all the objects from Maya scene
- Return recv_message
a list of object names
- Return type
- GetTimeSliderRange()[source]
Get the range of time slider
- Returns
[min, max] representing the minimum and maximum values of the timeline
- Return type
- MoveObjectWorldRelative(object_name: str, location: list)[source]
Move an object relatively with location [x, y, z]
- ScreenShot(save_file: str, camera='persp', width=1024, height=1024)[source]
Take maya screen shot and save to picture
- SendCommand(command: str)[source]
Send a string command to the socket server (Maya side)
- Parameters
command (str) – a string command
- SendPythonCommand(command: str)[source]
Send a string command to the socket server (Maya side)
- Parameters
command (str) – a string command
- SetCurrentKeyFrameForAttribute(object_name: str, attr_name: str)[source]
Set keyframe for object attribute
- SetCurrentKeyFrameForObjects(object_list)[source]
Set keyframe for a list of objects
- Parameters
object_list (list) – a list of object names
- SetCurrentKeyFrameForPositionAndRotation(object_name: str)[source]
Set keyframe for object position and rotation
- Parameters
object_name (str) – name of the object in hierarchy view
- SetCurrentTimeFrame(time_frame: int)[source]
Set timeline in the Maya scene
- Parameters
time_frame (int) – key frame
- SetObjectAttribute(object_name: str, attr_name: str, value: float)[source]
Set object attriture with value
- SetObjectLocalRotation(object_name: str, rotation: list)[source]
Set world absolute location for object with rotation [x,y] or [x, y, z] in degree
- SetObjectLocalTransform(object_name: str, location: list)[source]
Set world absolute location for object with location [x,y] or [x, y, z]