mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Audio
- extract/integrate from NS to Avalon and Ftrack - load into Maya
This commit is contained in:
parent
02758aae1e
commit
3715600594
5 changed files with 82 additions and 4 deletions
22
pype/plugins/maya/load/load_audio.py
Normal file
22
pype/plugins/maya/load/load_audio.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from maya import cmds, mel
|
||||
|
||||
from avalon import api
|
||||
|
||||
|
||||
class AudioLoader(api.Loader):
|
||||
"""Specific loader of audio."""
|
||||
|
||||
families = ["audio"]
|
||||
label = "Import audio."
|
||||
representations = ["wav"]
|
||||
icon = "volume-up"
|
||||
color = "orange"
|
||||
|
||||
def load(self, context, name, namespace, data):
|
||||
start_frame = cmds.playbackOptions(query=True, min=True)
|
||||
sound_node = cmds.sound(
|
||||
file=context["representation"]["data"]["path"], offset=start_frame
|
||||
)
|
||||
mel.eval("setSoundDisplay {} 1".format(sound_node))
|
||||
|
||||
return [sound_node]
|
||||
Loading…
Add table
Add a link
Reference in a new issue