Jump to content

Starting a Flipbook to a Specified Folder in Python


gemini

Recommended Posts

Before all, OpenGL ROP. You may find it more convenient to work with this node using Python.

 

hou.GeometryViewport.saveFlipbook() still not in H15, but you can invoke HScript command viewwrite from Python. Example:

import hou
import toolutils


def viewname(viewer):
    viewname = {
        'desktop' : viewer.pane().desktop().name(),
        'pane' : viewer.name(),
        'type' :'world',
        'viewport': viewer.curViewport().name()
    }
    return '{desktop}.{pane}.{type}.{viewport}'.format(**viewname)


def viewwrite(options='', outpath='ip'):
    current_view = viewname(toolutils.sceneViewer())
    hou.hscript('viewwrite {} {} {}'.format(options, current_view, outpath))


viewwrite('-q 4 -f 1 10', "$HIP/flipbook/'$F3'.jpg")
Link to comment
Share on other sites

  • 2 weeks later...
On 4/12/2016 at 4:46 PM, f1480187 said:

Hi,

Colud You tell why it's not working reading the files back.

THX

G

 

import hou

import toolutils

 

hou.hscript( "loadseq -r a:/Projects/HoudiniTests/Python/flipbook/'$F3'.jpg")

print 1

 

Edited by gemini
Sorry I unfortunately I edited your code
Link to comment
Share on other sites

Hi,
Colud You tell why this code is not working for reading the captures files back.
THX
G
 -- code --
import hou
import toolutils
 
hou.hscript( "loadseq -r a:/Projects/HoudiniTests/Python/flipbook/'$F3'.jpg")
print 1

Edited by gemini
Link to comment
Share on other sites

Looks like it's MPlay-specific. Houdini doesn't know about loadseq command. Forum search says that you are first living human trying to use this command. hou.Mplay functionality still not implemented at all, like flipbook generaition classes, so, you are out of luck even with HScript, probably.

From Houdini Textport:

/ -> help loadseq
No installed command matches loadseq

From MPlay Textport:

mplay -> help loadseq
loadseq

    Loads a sequence of files into mplay.

 

But it is extremely easy to directly call MPlay as a program using Python:

import subprocess
import hou

ip = hou.expandString('$HB/mplay')
seq = hou.expandString('$HIP/flipbook/*.jpg')
subprocess.Popen([ip, seq])

 

Edited by f1480187
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...