Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to change frame rate by using userSetup.py (or userSetup.mel)

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
huseila
209 Views, 3 Replies

Unable to change frame rate by using userSetup.py (or userSetup.mel)

Hi all,

 

I tried to use this snippet in userSetup.py to make frame rate set to 25 when opening a new maya scene. But it doesn't work at all:

 

import maya.cmds as cmds

cmds.currentUnit(time='pal')

Also I tried the mel equivalent in userSetup.mel but also doesn't work. Just wondering is it possible to change frame rate when launching Maya ?

3 REPLIES 3
Message 2 of 4
Cagetron
in reply to: huseila

It might be the new scene setting that is on by default to reset your working units. It's oddly separate from your global prefs. Go to File > New Scene > options to disable it.

Message 3 of 4
huseila
in reply to: Cagetron

Hi Cagetron,
In fact i'm looking for a way to dynamically change the global fps setting when launching Maya. In our case we hope Maya can automatically set to proper fps when artist start working on different shows. I've found the solution and I'll share it in the following post 🙂
Message 4 of 4
huseila
in reply to: huseila

OK, I think this snippet works in userSetup.py 

import maya.cmds as cmds

import maya.utils


def set_fps(fps_name):

    cmds.currentUnit(time=fps_name)

 

# Get project fps data from server. It could be "film", "pal", "ntsc"
# The key point to drive "cmds.currentUnit" work is using "maya.utils.executeDeferred"
maya.utils.executeDeferred(lambda *args: set_fps(fps_name_from_server))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report