Skip to content

Commit

Permalink
Merge pull request #153 from jmoborn/master
Browse files Browse the repository at this point in the history
Houdini get node info tool
  • Loading branch information
bkingery committed Mar 28, 2013
2 parents dcc264d + 1de34e9 commit caf7313
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions houdini-tools/toolbar/byu_tools.shelf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<memberTool name="weeklyRender"/>
<memberTool name="new_texture"/>
<memberTool name="refreshOTL"/>
<memberTool name="nodeInfo"/>
</toolshelf>
</shelfDocument>
23 changes: 23 additions & 0 deletions houdini-tools/toolbar/nodeInfo.shelf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<shelfDocument>
<!-- This file contains definitions of shelves, toolbars, and tools.
It should not be hand-edited when it is being used by the application.
Note, that two definitions of the same element are not allowed in
a single file. -->

<tool name="nodeInfo" label="Node Info" icon="PLASMA_App">
<helpText><![CDATA[= Get Node Info=
"""Gets info about the currently selected asset."""
The selected node must be a digital asset.]]></helpText>
<script scriptType="python"><![CDATA[# Author Jeremy Oborn
# Digital Asset management for Owned
# Get information about a Digital Asset-whether it's checked out and by whom
import hou_asset_mgr as mgr
node = mgr.getSelectedNode()
mgr.getNodeInfo(node)]]></script>
</tool>
</shelfDocument>
8 changes: 4 additions & 4 deletions maya-tools/shelf/scripts/maya_rollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def showWarningDialog(self):
, button = ['Yes', 'No']
, defaultButton = 'No'
, cancelButton = 'No'
, dismissString = 'No')
, dismissString = 'No'
, backgroundColor = [1.0, 0, 0])

def show_no_file_dialog(self):
return cmd.confirmDialog( title = 'No Such Version'
Expand All @@ -135,15 +136,14 @@ def verify_checkout_dialog(self):
, defaultButton = 'No'
, cancelButton = 'No'
, dismissString = 'No')

def verify_open_version_dialog(self):
return cmd.confirmDialog( title = 'Read Only File'
, message = 'This is meant to be a read only file and should not be edited. If you want to edit this version, please click the \'Checkout Version\' button.'
, button = ['Ok']
, defaultButton = 'Ok'
, cancelButton = 'Ok'
, dismissString = 'Ok'
, backgroundColor = [1.0, 0, 0])

, dismissString = 'Ok')

def open_version(self):
dialogResult = self.verify_open_version_dialog()
Expand Down
14 changes: 14 additions & 0 deletions python2.6libs/hou_asset_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,3 +734,17 @@ def newTexture():

# Output final success message
ui.infoWindow('Your texture was saved to: '+newfilepath+' as a .exr image file')

def getNodeInfo(node):
if isDigitalAsset():
updateDB()
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
nodeInfo = getFileInfo(filename)
message = ''
logname, realname = amu.lockedBy(nodeInfo[3].encode('utf-8'))
if nodeInfo[2]:
message = 'Checked out by '+realname+' ('+logname+')'
else:
message = 'Not checked out. Last checked in by '+realname+' ('+logname+')'
ui.infoWindow(message, wtitle='Node Info')

0 comments on commit caf7313

Please sign in to comment.