From 08084b899d18fd1c34eafc2e93253d72754f478f Mon Sep 17 00:00:00 2001 From: FadyFS Date: Wed, 7 Jun 2023 14:01:05 +0200 Subject: [PATCH 01/12] use frame sequence ok --- .../hosts/maya/plugins/load/load_arnold_standin.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 7c3a732389..4e8941e0ad 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -16,10 +16,13 @@ from openpype.hosts.maya.api.pipeline import containerise def is_sequence(files): sequence = False - collections, remainder = clique.assemble(files) + print("here calling") + if len(files) == 1: + collections, remainder = clique.assemble(files, minimum_items=1) + else: + collections, remainder = clique.assemble(files) if collections: sequence = True - return sequence @@ -84,6 +87,7 @@ class ArnoldStandinLoader(load.LoaderPlugin): sequence = is_sequence(os.listdir(os.path.dirname(self.fname))) cmds.setAttr(standin_shape + ".useFrameExtension", sequence) + nodes = [root, standin, standin_shape] if operator is not None: nodes.append(operator) @@ -146,6 +150,10 @@ class ArnoldStandinLoader(load.LoaderPlugin): os.path.basename(path), type="string" ) + print("#"*100) + + + # Object name value cmds.connectAttr( string_replace_operator + ".out", From 15766ae910e9fa4414e3512d5a3fe52c95052d90 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Wed, 7 Jun 2023 15:06:56 +0200 Subject: [PATCH 02/12] blanks spaces + correct FPS imported --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 4e8941e0ad..881e6a5643 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -16,7 +16,6 @@ from openpype.hosts.maya.api.pipeline import containerise def is_sequence(files): sequence = False - print("here calling") if len(files) == 1: collections, remainder = clique.assemble(files, minimum_items=1) else: @@ -86,7 +85,7 @@ class ArnoldStandinLoader(load.LoaderPlugin): cmds.setAttr(standin_shape + ".dso", path, type="string") sequence = is_sequence(os.listdir(os.path.dirname(self.fname))) cmds.setAttr(standin_shape + ".useFrameExtension", sequence) - + cmds.setAttr(standin_shape + ".abcFPS", 30) nodes = [root, standin, standin_shape] if operator is not None: @@ -150,11 +149,8 @@ class ArnoldStandinLoader(load.LoaderPlugin): os.path.basename(path), type="string" ) - print("#"*100) - # Object name value - cmds.connectAttr( string_replace_operator + ".out", "{}.inputs[{}]".format( From c49b59a7eaadd223069fc77601be0047fa212067 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Thu, 8 Jun 2023 11:14:41 +0200 Subject: [PATCH 03/12] getter for fps project --- .../maya/plugins/load/load_arnold_standin.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 881e6a5643..4bc4a1bbe5 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -6,10 +6,11 @@ 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 @@ -24,6 +25,17 @@ def is_sequence(files): sequence = True return sequence +#get the fps from the project itself +def get_fps(standin_shape): + + fps = convert_to_maya_fps( + float(legacy_io.Session.get("AVALON_FPS", 25)) + ) + return fps + + + + class ArnoldStandinLoader(load.LoaderPlugin): """Load as Arnold standin""" @@ -85,7 +97,10 @@ class ArnoldStandinLoader(load.LoaderPlugin): cmds.setAttr(standin_shape + ".dso", path, type="string") sequence = is_sequence(os.listdir(os.path.dirname(self.fname))) cmds.setAttr(standin_shape + ".useFrameExtension", sequence) - cmds.setAttr(standin_shape + ".abcFPS", 30) + + cmds.setAttr(standin_shape + ".dso", path, type="string") + matching_fps = get_fps(os.listdir(os.path.dirname(self.fname))) + cmds.setAttr(standin_shape + ".abcFPS", matching_fps) nodes = [root, standin, standin_shape] if operator is not None: From 873922d2753cc53d5e396a2236933a844deb61d6 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Thu, 8 Jun 2023 11:48:25 +0200 Subject: [PATCH 04/12] FPS corrected --- .../hosts/maya/plugins/load/load_arnold_standin.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 4bc4a1bbe5..0d76ba9f84 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -10,7 +10,10 @@ from openpype.pipeline import ( get_representation_path ) from openpype.hosts.maya.api.lib import ( - unique_namespace, get_attribute_input, maintained_selection, convert_to_maya_fps + unique_namespace, + get_attribute_input, + maintained_selection, + convert_to_maya_fps ) from openpype.hosts.maya.api.pipeline import containerise @@ -25,7 +28,6 @@ def is_sequence(files): sequence = True return sequence -#get the fps from the project itself def get_fps(standin_shape): fps = convert_to_maya_fps( @@ -33,10 +35,6 @@ def get_fps(standin_shape): ) return fps - - - - class ArnoldStandinLoader(load.LoaderPlugin): """Load as Arnold standin""" From dce5483919f732d2f3055bdc1a267f10406a7a5b Mon Sep 17 00:00:00 2001 From: FadyFS Date: Thu, 8 Jun 2023 11:54:28 +0200 Subject: [PATCH 05/12] no trailing whitespaces --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 0d76ba9f84..27c88869de 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -10,9 +10,9 @@ from openpype.pipeline import ( 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 From 786ee1bf37a145754bc59e95a25de14abbfa9793 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Thu, 8 Jun 2023 16:28:56 +0200 Subject: [PATCH 06/12] Updated method to get correct FPS from abc file --- .../hosts/maya/plugins/load/load_arnold_standin.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 27c88869de..61f093fbf3 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -17,7 +17,6 @@ from openpype.hosts.maya.api.lib import ( ) from openpype.hosts.maya.api.pipeline import containerise - def is_sequence(files): sequence = False if len(files) == 1: @@ -28,13 +27,6 @@ def is_sequence(files): sequence = True return sequence -def get_fps(standin_shape): - - fps = convert_to_maya_fps( - float(legacy_io.Session.get("AVALON_FPS", 25)) - ) - return fps - class ArnoldStandinLoader(load.LoaderPlugin): """Load as Arnold standin""" @@ -96,9 +88,8 @@ class ArnoldStandinLoader(load.LoaderPlugin): sequence = is_sequence(os.listdir(os.path.dirname(self.fname))) cmds.setAttr(standin_shape + ".useFrameExtension", sequence) - cmds.setAttr(standin_shape + ".dso", path, type="string") - matching_fps = get_fps(os.listdir(os.path.dirname(self.fname))) - cmds.setAttr(standin_shape + ".abcFPS", matching_fps) + fps = float(version["data"]["fps"]) + cmds.setAttr(standin_shape + ".abcFPS", fps) nodes = [root, standin, standin_shape] if operator is not None: From bf15830a9a7d464279e92cd4ee45b0d2a1075395 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Thu, 8 Jun 2023 17:42:05 +0200 Subject: [PATCH 07/12] new fps getter --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 61f093fbf3..2b07b1ca51 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -27,6 +27,10 @@ def is_sequence(files): sequence = True return sequence +def get_current_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""" @@ -88,7 +92,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"]["fps"]) + fps = float(version["data"].get("fps")) + if fps is None: + fps = get_current_fps() cmds.setAttr(standin_shape + ".abcFPS", fps) nodes = [root, standin, standin_shape] From d2ef628b22dd5bd97e46ce8c82a8381ffcf7ae3d Mon Sep 17 00:00:00 2001 From: FadyFS Date: Thu, 8 Jun 2023 17:44:27 +0200 Subject: [PATCH 08/12] new fps getter updated --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 2b07b1ca51..92b1433bb3 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -27,6 +27,7 @@ def is_sequence(files): sequence = True return sequence + def get_current_fps(): session_fps = float(legacy_io.Session.get('AVALON_FPS', 25)) return convert_to_maya_fps(session_fps) From 8c3d5be711bccb68f4c7897505c0a83d1b9cef37 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Mon, 12 Jun 2023 11:08:12 +0200 Subject: [PATCH 09/12] reviews --- .../hosts/maya/plugins/load/load_arnold_standin.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 92b1433bb3..0b75915cb5 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -19,10 +19,7 @@ from openpype.hosts.maya.api.pipeline import containerise def is_sequence(files): sequence = False - if len(files) == 1: - collections, remainder = clique.assemble(files, minimum_items=1) - else: - collections, remainder = clique.assemble(files) + collections, remainder = clique.assemble(files, minimum_items=1) if collections: sequence = True return sequence @@ -93,9 +90,7 @@ 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")) - if fps is None: - fps = get_current_fps() + fps = float(version["data"].get("fps"), get_current_fps()) cmds.setAttr(standin_shape + ".abcFPS", fps) nodes = [root, standin, standin_shape] @@ -161,7 +156,6 @@ class ArnoldStandinLoader(load.LoaderPlugin): type="string" ) - # Object name value cmds.connectAttr( string_replace_operator + ".out", "{}.inputs[{}]".format( From ba4ce235e2563da7dc0d90d27c5a129b04b21ca5 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Mon, 12 Jun 2023 11:23:05 +0200 Subject: [PATCH 10/12] update fps attribute --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 0b75915cb5..f62749f587 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -90,7 +90,7 @@ 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"), get_current_fps()) + fps = float(version["data"].get("fps")) or get_current_fps() cmds.setAttr(standin_shape + ".abcFPS", fps) nodes = [root, standin, standin_shape] From ebc38d6d4fd0e003545dc00d23bdfeb36adaa91d Mon Sep 17 00:00:00 2001 From: FadyFS Date: Mon, 12 Jun 2023 11:34:49 +0200 Subject: [PATCH 11/12] get current session fps --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index f62749f587..74dd54a472 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -25,7 +25,7 @@ def is_sequence(files): return sequence -def get_current_fps(): +def get_current_session_fps(): session_fps = float(legacy_io.Session.get('AVALON_FPS', 25)) return convert_to_maya_fps(session_fps) @@ -90,7 +90,7 @@ 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_fps() + fps = float(version["data"].get("fps")) or get_current_session_fps() cmds.setAttr(standin_shape + ".abcFPS", fps) nodes = [root, standin, standin_shape] From addec3fd7a65dc67fa9005414b4035a9cd6e3867 Mon Sep 17 00:00:00 2001 From: FadyFS Date: Mon, 12 Jun 2023 13:55:28 +0200 Subject: [PATCH 12/12] line correction --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 74dd54a472..0040baeec3 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -90,7 +90,7 @@ 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() + fps = float(version["data"].get("fps"))or get_current_session_fps() cmds.setAttr(standin_shape + ".abcFPS", fps) nodes = [root, standin, standin_shape]