diff --git a/pype/hooks/celaction/prelaunch.py b/pype/hooks/celaction/prelaunch.py index df9da6cbbf..e1e86cc919 100644 --- a/pype/hooks/celaction/prelaunch.py +++ b/pype/hooks/celaction/prelaunch.py @@ -106,7 +106,7 @@ class CelactionPrelaunchHook(PypeHook): f"--project {project}", f"--asset {asset}", f"--task {task}", - "--currentFile \"*SCENE*\"", + "--currentFile \\\"\"*SCENE*\"\\\"", "--chunk *CHUNK*", "--frameStart *START*", "--frameEnd *END*", diff --git a/pype/hosts/celaction/cli.py b/pype/hosts/celaction/cli.py index 8cf2bcc791..42f7a1a385 100644 --- a/pype/hosts/celaction/cli.py +++ b/pype/hosts/celaction/cli.py @@ -46,9 +46,6 @@ def cli(): parser.add_argument("--resolutionHeight", help=("Height of resolution")) - # parser.add_argument("--programDir", - # help=("Directory with celaction program installation")) - celaction.kwargs = parser.parse_args(sys.argv[1:]).__dict__ @@ -78,7 +75,7 @@ def _prepare_publish_environments(): env["AVALON_WORKDIR"] = os.getenv("AVALON_WORKDIR") env["AVALON_HIERARCHY"] = hierarchy env["AVALON_PROJECTCODE"] = project_doc["data"].get("code", "") - env["AVALON_APP"] = publish_host + env["AVALON_APP"] = f"hosts.{publish_host}" env["AVALON_APP_NAME"] = "celaction_local" env["PYBLISH_HOSTS"] = publish_host diff --git a/pype/plugins/blender/load/load_action.py b/pype/plugins/blender/load/load_action.py index d94bd9aac6..1f2a870640 100644 --- a/pype/plugins/blender/load/load_action.py +++ b/pype/plugins/blender/load/load_action.py @@ -174,22 +174,16 @@ class BlendActionLoader(pype.hosts.blender.plugin.AssetLoader): strips = [] - for obj in collection_metadata["objects"]: - + for obj in list(collection_metadata["objects"]): # Get all the strips that use the action arm_objs = [ arm for arm in bpy.data.objects if arm.type == 'ARMATURE'] for armature_obj in arm_objs: - if armature_obj.animation_data is not None: - for track in armature_obj.animation_data.nla_tracks: - for strip in track.strips: - if strip.action == obj.animation_data.action: - strips.append(strip) bpy.data.actions.remove(obj.animation_data.action) @@ -277,22 +271,16 @@ class BlendActionLoader(pype.hosts.blender.plugin.AssetLoader): objects = collection_metadata["objects"] lib_container = collection_metadata["lib_container"] - for obj in objects: - + for obj in list(objects): # Get all the strips that use the action arm_objs = [ arm for arm in bpy.data.objects if arm.type == 'ARMATURE'] for armature_obj in arm_objs: - if armature_obj.animation_data is not None: - for track in armature_obj.animation_data.nla_tracks: - for strip in track.strips: - if strip.action == obj.animation_data.action: - track.strips.remove(strip) bpy.data.actions.remove(obj.animation_data.action) diff --git a/pype/plugins/blender/load/load_animation.py b/pype/plugins/blender/load/load_animation.py index 1c0e6e0906..32050eca99 100644 --- a/pype/plugins/blender/load/load_animation.py +++ b/pype/plugins/blender/load/load_animation.py @@ -30,9 +30,7 @@ class BlendAnimationLoader(pype.hosts.blender.plugin.AssetLoader): color = "orange" def _remove(self, objects, lib_container): - - for obj in objects: - + for obj in list(objects): if obj.type == 'ARMATURE': bpy.data.armatures.remove(obj.data) elif obj.type == 'MESH': diff --git a/pype/plugins/blender/load/load_camera.py b/pype/plugins/blender/load/load_camera.py index 7fd8f94b4e..9dd5c2bfd8 100644 --- a/pype/plugins/blender/load/load_camera.py +++ b/pype/plugins/blender/load/load_camera.py @@ -28,8 +28,7 @@ class BlendCameraLoader(pype.hosts.blender.plugin.AssetLoader): color = "orange" def _remove(self, objects, lib_container): - - for obj in objects: + for obj in list(objects): bpy.data.cameras.remove(obj.data) bpy.data.collections.remove(bpy.data.collections[lib_container]) diff --git a/pype/plugins/blender/load/load_layout.py b/pype/plugins/blender/load/load_layout.py index cfab5a207b..6a51d7cf16 100644 --- a/pype/plugins/blender/load/load_layout.py +++ b/pype/plugins/blender/load/load_layout.py @@ -21,7 +21,7 @@ class BlendLayoutLoader(plugin.AssetLoader): color = "orange" def _remove(self, objects, obj_container): - for obj in objects: + for obj in list(objects): if obj.type == 'ARMATURE': bpy.data.armatures.remove(obj.data) elif obj.type == 'MESH': diff --git a/pype/plugins/blender/load/load_model.py b/pype/plugins/blender/load/load_model.py index ad9137a15d..4ac86b3aef 100644 --- a/pype/plugins/blender/load/load_model.py +++ b/pype/plugins/blender/load/load_model.py @@ -25,8 +25,8 @@ class BlendModelLoader(plugin.AssetLoader): color = "orange" def _remove(self, objects, container): - for obj in objects: - for material_slot in obj.material_slots: + for obj in list(objects): + for material_slot in list(obj.material_slots): bpy.data.materials.remove(material_slot.material) bpy.data.meshes.remove(obj.data) diff --git a/pype/plugins/blender/load/load_rig.py b/pype/plugins/blender/load/load_rig.py index e09a9cb92f..6dc2273c6e 100644 --- a/pype/plugins/blender/load/load_rig.py +++ b/pype/plugins/blender/load/load_rig.py @@ -25,7 +25,7 @@ class BlendRigLoader(plugin.AssetLoader): color = "orange" def _remove(self, objects, obj_container): - for obj in objects: + for obj in list(objects): if obj.type == 'ARMATURE': bpy.data.armatures.remove(obj.data) elif obj.type == 'MESH': diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index 9f20999f55..d151cfc608 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -514,12 +514,6 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): instance: the instance to integrate """ transfers = instance.data.get("transfers", list()) - - for src, dest in transfers: - if os.path.normpath(src) != os.path.normpath(dest): - self.copy_file(src, dest) - - transfers = instance.data.get("transfers", list()) for src, dest in transfers: self.copy_file(src, dest) diff --git a/pype/plugins/premiere/publish/validate_auto_sync_off.py b/pype/plugins/premiere/publish/validate_auto_sync_off.py index 1f3f0b58a5..cd6fef29c8 100644 --- a/pype/plugins/premiere/publish/validate_auto_sync_off.py +++ b/pype/plugins/premiere/publish/validate_auto_sync_off.py @@ -2,7 +2,11 @@ import sys import pyblish.api import pype.api import avalon.api -import six + +try: + from pype.modules.ftrack.lib.avalon_sync import CUST_ATTR_AUTO_SYNC +except Exception: + CUST_ATTR_AUTO_SYNC = "avalon_auto_sync" class ValidateAutoSyncOff(pyblish.api.ContextPlugin): @@ -16,15 +20,10 @@ class ValidateAutoSyncOff(pyblish.api.ContextPlugin): order = pyblish.api.ValidatorOrder families = ['clip'] label = 'Ftrack project\'s auto sync off' - actions = [pype.api.RepairAction] + actions = [pype.api.RepairContextAction] def process(self, context): - session = context.data["ftrackSession"] - project_name = avalon.api.Session["AVALON_PROJECT"] - query = 'Project where full_name is "{}"'.format(project_name) - project = session.query(query).one() invalid = self.get_invalid(context) - assert not invalid, ( "Ftrack Project has 'Auto sync' set to On." " That may cause issues during integration." @@ -36,14 +35,18 @@ class ValidateAutoSyncOff(pyblish.api.ContextPlugin): project_name = avalon.api.Session["AVALON_PROJECT"] query = 'Project where full_name is "{}"'.format(project_name) project = session.query(query).one() - - return project + if project["custom_attributes"][CUST_ATTR_AUTO_SYNC]: + return project @classmethod def repair(cls, context): session = context.data["ftrackSession"] invalid = cls.get_invalid(context) - invalid['custom_attributes']['avalon_auto_sync'] = False + if not invalid: + cls.log.info("Project 'Auto sync' already fixed.") + return + + invalid["custom_attributes"][CUST_ATTR_AUTO_SYNC] = False try: session.commit() except Exception: