Using Zbrush on Linux


Since the “Recent” tab in ZBrush Wine LightBox seem to work I decided to test a little Python to manipulate it.

It is possible to extend it for other features, but for now this is a quick prototype. If you have the slightest familiarity with Python3 feel free to test it when trying out Wine ZBrush.

#!/usr/bin/python3
from glob import glob
import getpass

# get username
username=getpass.getuser()

# define path to QuickSave
path = '/home/'+username+'/.wine/drive_c/users/Public/Documents/ZBrushData2021/QuickSave/'


# define path to LightboxRecentFiles.cfg
output_file = '/home/'+username+'/.wine/drive_c/users/Public/Documents/ZBrushData2021/ZStartup/ConfigFiles/LightboxRecentFiles.cfg'


# make a list for all found files in path
files_list = []
output_string = ''


# list files in path
files_list = glob(path+'/*.zpr')
#jpg_images_list = glob("*.JPG")
delimiter=bytes.fromhex('00').decode('utf-8')


for i in files_list:
  output_string = output_string+i+delimiter


# FIX path errors
# [error] /home/user/.wine/drive_c/users/Public/Documents/ZBrushData2021/QuickSave/QS_282.zpr
# [goal] /home/user/.wine/drive_c/users/Public/Documents/ZBrushData2021/QuickSave/QS_282.zpr
# [goal2] C:PROGRAM FILESPIXOLOGICZBRUSH 2021/ZProjects/DefaultProject.zpr

replace1='/home/'+username+'/.wine/drive_c'
replace1with='C:\'
output_string = output_string.replace(replace1, replace1with)

replace2='/'
replace2with='\'
output_string = output_string.replace(replace2, replace2with)


def write_to_file(data="test",file="/tmp/tmp.txt",append=True):
    if append:
        """append data to specified file"""
        with open(file, 'a') as the_file:
        	the_file.write(data)
    else:
        """write or overwrite data in specified file"""
        with open(file) as the_file:
        	the_file.write(data)


write_to_file(data=output_string, file=output_file)



Source link

Comments

Leave a Reply

%d bloggers like this: