-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scene-name for output #4
Comments
The output path defined through Something like # pseudocode (might work as is, but haven't tested)
import maya.cmds
import os
import capture
scene = cmds.file(query=True, sceneName=True)
filename, ext = os.path.splitext(scene)
capture(filename=filename) Also, what happens if scene hasn't been saved yet? |
You know, I'm not too sure what made me think of this feature initially. Possibly for it's simplicity, and generality; scripts could then be built without hard-coding any paths, and just assume the scene-name. But you're right, what if the scene hasn't been saved? I'd probably expect an exception at that point, what do you think? |
I think many will have their own naming conventions so won't use it at all. Maybe only when doing a very quick capture could it be useful? I think it's easier to stick to Maya's default conventions as a fallback for playblast locations. By default (if a path is relative) it will put it into the current workspace's
In practice if I would save with only a filename as opposed to a full path it would fall back on this system and do that? # pseudocode (might work as is, but haven't tested)
import maya.cmds
import os
import capture
filename = "playblast"
scene = cmds.file(query=True, sceneName=True)
if scene:
filename = os.path.basename(scene)
filename, ext = os.path.splitext(filename)
capture(filename=filename) I think that should capture into the movies directory with the scene name if file is saved, otherwise playblast is used. That should be similar to Maya's default behaviour through the UI. So we only pass the filename and not the absolute path to the |
I think that sounds good, but it's hard to tell without having a solid use case. Maybe let's find a use for it (in Magenta) and go from there? |
Sounds good. Actually to be complete. At the current stage capture.snap(filename='test')
capture.capture(filename='test') Both of these save to a different folder. The first goes into the Even more interesting is that saving through the Maya UI with playblast to filename
|
That rings a bell, but can't be sure.. |
…n for best viewing. - Moved `maintain_aspect_ratio` to `capture()` command so it could also be used for `maya.cmds.playblast` widthHeight. - Center the independent on the screen to improve the viewing experience.
I think this should just be added as an example snippet in the readme instead of a global option. Something like this: import os
import maya.cmds as cmds
import capture
filepath = cmds.file(q=1, sn=1)
filename = os.path.splitext(os.path.basename(filepath))[0]
capture.capture(filename=filename) typed on phone, so there might be some typos I remember there even being an argument for I think more advanced technical artists might customize it further anyway then just the filenames and as such don't use this? What do you think? |
- Include example for capturing selected cameras abstractfactory#3 - Include example for saving to scene name abstractfactory#4
Yeah, I like this direction. Less features, more flexibility. |
Provide a flag for using the current scene name for output
The text was updated successfully, but these errors were encountered: