From 4f9fa3cd72e911e971b536457648cbdb7bce1d96 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 8 Mar 2024 17:49:52 +0800 Subject: [PATCH] removing loading enhancement and wait for zbrush update --- client/ayon_core/hosts/zbrush/api/lib.py | 54 ------------------- .../hosts/zbrush/plugins/load/load_mesh.py | 28 ++-------- 2 files changed, 3 insertions(+), 79 deletions(-) diff --git a/client/ayon_core/hosts/zbrush/api/lib.py b/client/ayon_core/hosts/zbrush/api/lib.py index 9b76e6f726..05e924db76 100644 --- a/client/ayon_core/hosts/zbrush/api/lib.py +++ b/client/ayon_core/hosts/zbrush/api/lib.py @@ -99,60 +99,6 @@ def execute_zscript_and_wait(zscript, f"{timeout}s to run." ) -def execute_load_zscript(zscript): - """Function to execute ZScript after checking on whether ZFileUtil - plugins has been installed before loading mesh. - """ - find_file_util_zscript=""" -[RoutineDef, CheckSystem, - //check ZBrush version - [VarSet, Zvers, [ZBrushInfo,0]] - [If, [Val, Zvers] >= 4.8,, - [Note,"\Cff9923This zscript\Cffffff is not designed for this version of \Cff9923ZBrush\Cffffff.",, 3, 4737096,, 300] - [Exit] - ] - //check Mac or PC - [VarSet, isMac, [ZBrushInfo, 6]] - - // Make sure we have the dll and set its path - [If, [ZBrushInfo, 16] == 64,//64 bit - [If, isMac, - [VarSet,dllPath,[FileNameResolvePath, "ZFileUtils.lib"]] - , - [VarSet,dllPath,[FileNameResolvePath, "ZFileUtils64.dll"]] - ] - , //else 32 bit - no longer supported - [Note, "\Cff9923This zscript\Cffffff is not designed for this version of \Cff9923ZBrush\Cffffff.",, 3, 4737096,, 300] - [Exit] - ] - [If, [FileExists, [Var, dllPath]], - //check that correct version - [VarSet, dllVersion, [FileExecute, [Var, dllPath], Version]] - [If, [Val,dllVersion] >= 3.0,//dll version - //OK - ,//else earlier version - [Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ZFileUtils plugin \CffffffDLL\Cc0c0c0 is an earlier version which does not support this plugin. Please install correct version."] - [Exit] - ] - , // else no DLL. - [Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ZFileUtils plugin \CffffffDLL\Cc0c0c0 could - not be found at the correct location. Please re-install the plugin, making sure the - relevant files and folders are in the \CffffffZStartup/ZPlugs\Cc0c0c0 folder."] - [Exit] - ] - // set dll path in memory block - [If, [MemGetSize, AYONFileUtilPath], - [MemResize, AYONFileUtilPath, [StrLength, dllPath]] - , - [MemCreate, AYONFileUtilPath, [StrLength, dllPath]] - ] - [VarSet, size, [MemWriteString, AYONFileUtilPath, #dllPath,0,0]] - [MemResize, AYONFileUtilPath, size] - -]//end routine -""" - execute_zscript(find_file_util_zscript) - execute_zscript(zscript) def find_first_filled_path(path): if not path: diff --git a/client/ayon_core/hosts/zbrush/plugins/load/load_mesh.py b/client/ayon_core/hosts/zbrush/plugins/load/load_mesh.py index 89319994b8..0abdc61f2d 100644 --- a/client/ayon_core/hosts/zbrush/plugins/load/load_mesh.py +++ b/client/ayon_core/hosts/zbrush/plugins/load/load_mesh.py @@ -3,7 +3,7 @@ from ayon_core.pipeline import load, get_representation_path from ayon_core.hosts.zbrush.api.pipeline import ( containerise, remove_container_data, imprint ) -from ayon_core.hosts.zbrush.api.lib import execute_load_zscript, remove_subtool +from ayon_core.hosts.zbrush.api.lib import execute_zscript, remove_subtool class MeshLoader(load.LoaderPlugin): @@ -22,21 +22,10 @@ class MeshLoader(load.LoaderPlugin): [VarSet, filename, "{filepath}"] [FileNameSetNext, #filename] [IKeyPress, 13, [IPress, Tool:Import:Import]] -[VarSet,totalSubtools,[SubToolGetCount]] -[VarSet, dllPath, ""] -[MemReadString, AYONFileUtilPath, dllPath] -[Loop, totalSubtools, - [SubToolSelect, [Val, n]] - [VarSet, subtoolOldName, [IGetTitle, "Tool:ItemInfo"]] // Get the tool name - [VarSet, subtoolOldName, [StrExtract, subtoolName, 0, [StrLength, subtoolName] - 2]] - [VarSet, subtoolNewName, [StrMerge, "{name}", ":", subtoolOldName]] - [FileExecute, #dllPath, RenameSetNext, subtoolNewName] - [IPress, “Tool:Subtool:Rename”] -, n] ] """).format(filepath=file_path, name=name) - execute_load_zscript(load_zscript) + execute_zscript(load_zscript) return containerise( name, @@ -51,21 +40,10 @@ class MeshLoader(load.LoaderPlugin): [VarSet, filename, "{filepath}"] [FileNameSetNext, #filename] [IKeyPress, 13, [IPress, Tool:Import:Import]] -[VarSet,totalSubtools,[SubToolGetCount]] -[VarSet, dllPath, ""] -[MemReadString, AYONFileUtilPath, dllPath] -[Loop, totalSubtools, - [SubToolSelect, [Val, n]] - [VarSet, subtoolOldName, [IGetTitle, "Tool:ItemInfo"]] // Get the tool name - [VarSet, subtoolOldName, [StrExtract, subtoolName, 0, [StrLength, subtoolName] - 2]] - [VarSet, subtoolNewName, [StrMerge, "{name}", ":", subtoolOldName]] - [FileExecute, #dllPath, RenameSetNext, subtoolNewName] - [IPress, “Tool:Subtool:Rename”] -, n] ] """).format(filepath=path) - execute_load_zscript(load_zscript) + execute_zscript(load_zscript) representation_id = str(repre_doc["_id"]) imprint(container, representation_id)