Merge pull request #5110 from quadproduction/424-enhancement-animation-family-loaded-as-standin-abc-dont-have-correct-fps-and-use-file-sequence-ticked

This commit is contained in:
Milan Kolar 2023-06-23 08:45:19 +02:00 committed by GitHub
commit d134c94efe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,23 +6,29 @@ import maya.cmds as cmds
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
legacy_io,
get_representation_path
)
from openpype.hosts.maya.api.lib import (
unique_namespace, get_attribute_input, maintained_selection
unique_namespace,
get_attribute_input,
maintained_selection,
convert_to_maya_fps
)
from openpype.hosts.maya.api.pipeline import containerise
def is_sequence(files):
sequence = False
collections, remainder = clique.assemble(files)
collections, remainder = clique.assemble(files, minimum_items=1)
if collections:
sequence = True
return sequence
def get_current_session_fps():
session_fps = float(legacy_io.Session.get('AVALON_FPS', 25))
return convert_to_maya_fps(session_fps)
class ArnoldStandinLoader(load.LoaderPlugin):
"""Load as Arnold standin"""
@ -90,6 +96,9 @@ class ArnoldStandinLoader(load.LoaderPlugin):
sequence = is_sequence(os.listdir(os.path.dirname(self.fname)))
cmds.setAttr(standin_shape + ".useFrameExtension", sequence)
fps = float(version["data"].get("fps"))or get_current_session_fps()
cmds.setAttr(standin_shape + ".abcFPS", fps)
nodes = [root, standin, standin_shape]
if operator is not None:
nodes.append(operator)