Isotropix Forums

Playblast Viewer

Clarisse Scripting related topics

Playblast Viewer

Unread postby jandersunstar » Fri Feb 01, 2019 11:24 pm

The Playblast feature was something that I was really exited about it, but I thought that it will have a player like in Houdini.

So I had to find a free sequence player and make a python script for it.

I am using DJV Imaging (http://djv.sourceforge.net/), just download it and install it. I am using windows, so the exec file is here: C:/Program Files/DJV/bin/djv_view.exe

Here is the scipt:


Code: Select all
# Runs the latest blast using the djv player.
# It looks for the latest PNG sequence in the temp folder.

RunJDV = "C:/Program Files/DJV/bin/djv_view.exe"
sequenceFormat = "png"

import glob
import os
import subprocess
import tempfile

path = tempfile.gettempdir() # gets the current temporary directory
list_of_files = glob.glob(path + '/*.' + sequenceFormat) # list all the files inside the temp folder
latest_file = max(list_of_files, key=os.path.getctime) # gets the last file

subprocess.call([RunJDV, latest_file, '-playback', 'forward']) # runs the player


Just execute the script and it will search for the latest file (png sequence) in the temp folder and play it. You won't be able to use Clarisse until you close it.

I hope you find this tool useful.
cheers! and congrats on this fantastic release!

-Luis
User avatar
jandersunstar
 
Posts: 271
Joined: Fri Jun 06, 2014 8:21 pm
Location: Mexico City

Re: Playblast Viewer

Unread postby ayanik » Sat Feb 02, 2019 12:24 am

Awesome. Thanks for sharing.

If you spawn the subprocess in a thread you might work around the issue of having to close the viewer before you can use Clarisse again. In my Megascans bridge script I used os.system instead of subprocess. The time sleep is used because sometimes Clarisse does not spawn the thread, because the script is done running quicker than it spawned the thread.

Code: Select all
import os
import threading
import time


def run_script():
    os.system('insert path here'))


t = threading.Thread(target=run_script)
t.start()
time.sleep(1)
ayanik
 
Posts: 41
Joined: Wed Nov 26, 2014 9:10 pm

Re: Playblast Viewer

Unread postby pulverfass » Sat Feb 02, 2019 1:48 pm

Thanks Jan!
Works like a charm :)
pulverfass
 
Posts: 25
Joined: Mon Mar 05, 2018 1:10 pm

Re: Playblast Viewer

Unread postby dboude » Mon Feb 04, 2019 11:19 am

Thanks for sharing Jan ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 699
Joined: Mon Jul 03, 2017 10:51 am

Re: Playblast Viewer

Unread postby dougike » Mon Feb 04, 2019 4:07 pm

Thanks for doing this Luis!
dougike
 
Posts: 13
Joined: Sun Aug 31, 2014 6:44 pm


Return to Scripting
cron