Pancho Posted February 17, 2020 Share Posted February 17, 2020 I can't find anything in the docs nor the web. I'm so sick of entering manually details into the save dialogs in the mplay window. I actually want to script a shelf button which puts in a filename related to my scene and take, chooses the format, adds a comment and probably some other settings and presses the "save" button in one go. Unfortunately there is no obvious documentation popping in my eye. Can it be done? Or what would be the alternative? In a production is feels so clumsy to enter these parameters over and over again. Cheers Tom Quote Link to comment Share on other sites More sharing options...
garf Posted February 17, 2020 Share Posted February 17, 2020 https://www.sidefx.com/docs/houdini/hom/hou/FlipbookSettings.html Quote Link to comment Share on other sites More sharing options...
Pancho Posted February 18, 2020 Author Share Posted February 18, 2020 Thanks for the link, but as far as I can tell, this is about the flipbook. Mplay seems to be the external file that Houdini runs to display the frames. And I would need to get hold off the code which is needed to alter Mplays windows and parameters. Quote Link to comment Share on other sites More sharing options...
garf Posted February 18, 2020 Share Posted February 18, 2020 Mplay's dev kit is pretty limited as far as I know, but I've created a few custom flipbooks in the past using python and mplay. This is will do the bulk of what you want to achieve. Essentially you want to write files to either to disk or directly into mplay - this will do that. Quote Link to comment Share on other sites More sharing options...
Pancho Posted February 18, 2020 Author Share Posted February 18, 2020 Thanks! I thought what I can do by hand can be achieved with python, too. : ) , Quote Link to comment Share on other sites More sharing options...
DonRomano Posted February 18, 2020 Share Posted February 18, 2020 I've done something similar a while ago if I understand you right, with flipbooks import os #Choose the camera all_cams = hou.node("/obj").glob("cam*") desktop = hou.ui.curDesktop() scene_viewer = desktop.paneTabOfType(hou.paneTabType.SceneViewer) viewport = scene_viewer.curViewport() if len(all_cams)>0: camera = hou.ui.selectNode(node_type_filter = hou.nodeTypeFilter.ObjCamera) cam = hou.node(camera) else: name = hou.ui.readInput("Enter camera name :", buttons=("OK", "Cancel")) cam = hou.node("/obj").createNode("cam", name[1]) hou.GeometryViewport.saveViewToCamera(viewport, cam) #Create comments group = cam.parmTemplateGroup() if group.find("vcomment") > -1: group.remove(group.find("vcomment")) group.remove(group.findFolder("Comment")) folder = hou.FolderParmTemplate("OpenGL View", "Comment") parm = hou.StringParmTemplate("vcomment", "Comment", 1) parm.setTags({"editor": "1"}) folder.addParmTemplate(parm) group.append(folder) cam.setParmTemplateGroup(group) commentCount = hou.ui.readInput("Number of Comments :", buttons=("Ok", "Cancel")) print int(commentCount[1]) comments = [] for i in range(0, int(commentCount[1])): comments.append("Comment" + "_" + str(i)) commentInput = hou.ui.readMultiInput("Enter your Comment :", comments, buttons=("Ok", "Cancel")) comment = "\n".join(commentInput[1]) cam.parm("vcomment").set(comment) hou.GeometryViewport.setCamera(viewport, cam) #Create the flipbook cur_desktop = hou.ui.curDesktop() scene = cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer) flipbook_options = scene.flipbookSettings().stash() flipbook_options.outputToMPlay(True) flipbook_options.useResolution(False) flipbook_options.cropOutMaskOverlay(False) flipbook_options.frameRange(hou.playbar.timelineRange()) flipbook_options.outputZoom(100) Maybe it can help.. Cheers, Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 19, 2020 Share Posted February 19, 2020 Mplay saving comments on the images ? Quote Link to comment Share on other sites More sharing options...
trzanko Posted February 22, 2020 Share Posted February 22, 2020 Been having a go at this with shadesoforange Using xml to append a menu you can get to a place where you can execute python, but there is an issue when trying to use hou.ui, it states that 'module' object has no attribute 'ui', hou.qt throws the same error. You can get access to the hou module without having to import, so it is working, you are able to do things like write out hou.getenv('foo') to a file. What might be the limitation on accessing hou.ui here? Also, there is seemingly no way to get access to the current mplay session for writing it out or doing stuff, as it is dependent on a hou.SceneViewer object to actually stash the settings. Going to write to sesi with these findings, does anyone know of any options here we might be missing? <?xml version="1.0" encoding="UTF-8"?> <mainMenu> <menuBar> <subMenu id = "extra_menu"> <modifyItem><insertAfter>window_menu</insertAfter></modifyItem> <label>Extra</label> <scriptItem id="export_sequence"> <label>Export Sequence</label> <scriptCode><![CDATA[ hou.ui.selectFile() ]]> </scriptCode> </scriptItem> </subMenu> </menuBar> </mainMenu> Quote Link to comment Share on other sites More sharing options...
michaelb-01 Posted October 20, 2020 Share Posted October 20, 2020 @trzanko Have you managed to run a python script from an Mplay menu? I've tried importing it from: $HOUDINI_PATH/scripts $HOUDINI_PATH/scripts/python $HOUDINI_PATH/python2.7libs In Houdini all of those paths are fine but Mplay doesn't see them.. And I can't seem to do a relative import either.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.