Comments (8)
The output path defined through filename
is the complete destination path and not only the file's name. So do you mean this would save the playblast next to the working file?
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?
from maya-capture.
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?
from maya-capture.
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 movies
file rule directory. For example this could be in the workspace.mel
for a project:
workspace -fr "movie" "movies";
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 maya.cmds.playblast
command and use Maya's fallback.
from maya-capture.
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?
from maya-capture.
Sounds good.
Actually to be complete. At the current stage capture
will fall back on Maya's system anyway for relative paths. Though I did notice something odd:
capture.snap(filename='test')
capture.capture(filename='test')
Both of these save to a different folder. The first goes into the images
folder, the other saves next to the file. This makes me think it uses the format
flag to derive what type of file it is? Usually there is no file rule for qt
so it saves next to it?
Even more interesting is that saving through the Maya UI with playblast to filename test
generates the following mel command:
playblast -format qt -filename "movies/test.mov" -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 1 -fp 4 -percent 100 -compression "H.264" -quality 100 -widthHeight 960 540;
from maya-capture.
This makes me think it uses the format flag to derive what type of file it is?
That rings a bell, but can't be sure..
from maya-capture.
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 cmds.file
to only retrieve the file's name as opposed to full path, so maybe you could even do it without os
.
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?
from maya-capture.
Yeah, I like this direction. Less features, more flexibility.
from maya-capture.
Related Issues (20)
- Maintain resolution results in inaccurate resolutions
- Capture will take playback range when start or end frame is set to 0
- Add renderer option HOT 3
- Default compression h264 doesn't result in h264 compressed video HOT 6
- Missing some ViewportOptions keys HOT 2
- Missing frame padding argument for capture HOT 3
- Workaround Maya error when using raw frame numbers with only start and end frame
- Behavior of `complete_filename` argument in docstring is described incorrectly HOT 2
- Ignore raw_frame_numbers when not playblasting to image format HOT 1
- Add "Pan/Zoom" state to default options for capture
- Define custom saving behavior HOT 1
- Fix py linting errors
- fix format variable HOT 2
- Capture with Maya 2018? HOT 12
- ViewPort2 option "floatingPointRTEnable" set to False for Maya 2016 Standalone HOT 2
- setup.py has maya and PySide(2) as dependencies HOT 2
- support for backface culling HOT 1
- flatShaded mode will render black if viewport is not set to flatShaded prior to capture HOT 3
- Maya Batch Mode does not respect viewport_options HOT 2
- Maya 2025 with Qt6 support fails due to usage of `QDesktopWidget` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maya-capture.